Hello

Based on the error message, it seems that @interface is nil for some reason. 
OTOH I don't understand why it wouldn't fail on @interface.ip few lines above.

Sorry, no more ideas

--
Marek

On pondělí 9. října 2017 17:16:23 CEST Mike Wilson wrote:
> On Monday, October 9, 2017 at 4:01:16 AM UTC-5, Marek Hulán wrote:
> > Hello,
> > 
> > it looks like http://projects.theforeman.org/issues/14664 which was fixed
> > in
> > 1.13, subnet6 is among allowed attributes. The error message might be
> > misleading, double check the host interfaces. You can debug the snippet
> > using
> > the preview button when editing the template.
> 
> So I did run a preview on various hosts and it failed on all of them. The
> output wasn't helpful other than to say it failed. Not why it failed. The
> errors in the log look the similar as well.
> 
> 2017-10-09 15:12:44 6d0e1450 [templates] [I] Rendering template
> 'kickstart_ifcfg_generic_interface'
> 2017-10-09 15:12:44 6d0e1450 [app] [W] Error rendering the
> kickstart_ifcfg_generic_interface template
> 
>  | Safemode::NoMethodError: undefined method '#ip6' for NilClass::Jail
> 
> (NilClass)
> 
> /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.1/lib/safemode/jai
> l.rb:22:in `method_missing'
> 
>  | kickstart_ifcfg_generic_interface:71:in `bind'
> 
>  Also, you mentioned 1.13, we're running 1.15.1.
> 
> Here is the snippet we have currently.
> 
> <%#
> name: kickstart_ifcfg_generic_interface
> snippet: true
> model: ProvisioningTemplate
> kind: snippet
> -%>
> BOOTPROTO="<%= @dhcp ? 'dhcp' : 'none' -%>"
> <%- unless @dhcp || @subnet.nil? -%>
> <%-   if @interface.ip.present? -%>
> <%=     "IPADDR=\"#{@interface.ip}\"" %>
> <%=     "NETMASK=\"#{@subnet.mask}\"" %>
> <%-     if @subnet.gateway.present? -%>
> <%=       "GATEWAY=\"#{@subnet.gateway}\"" %>
> <%-     end -%>
> <%-   end -%>
> <%- end -%>
> <%- if @interface.ip6.present? -%>
> <%=   "IPV6INIT=yes" %>
> <%=   "IPV6_AUTOCONF=no" %>
> <%=   "IPV6ADDR=#{@interface.ip6}" %>
> <%-   if [email protected]? && @subnet6.gateway.present? -%>
> <%=     "IPV6_DEFAULTGW=#{@subnet6.gateway}" %><%= '%$real' if
> subnet6.gateway.match(/^fe80:/) %>
> <%-   end -%>
> <%=   "IPV6_PEERDNS=no" %>
> <%- end -%>
> DEVICE=$real
> <%- unless @interface.virtual? -%>
> <%=   "HWADDR=\"#{@interface.mac}\"" %>
> <%- end -%>
> ONBOOT=yes
> <%- primary = @interface.primary ? 'yes' : 'no' -%>
> PEERDNS=<%= primary %>
> PEERROUTES=<%= primary %>
> DEFROUTE=<%= primary %>
> <%- if @interface.primary -%>
> <%-   if !@dhcp && @subnet && @subnet.dns_primary.present? -%>
> <%=     "DNS1=\"#{@subnet.dns_primary}\"" %>
> <%-     if @subnet.dns_secondary.present? -%>
> <%=       "DNS2=\"#{@subnet.dns_secondary}\"" %>
> <%-     end -%>
> <%-   end -%>
> <%- end -%>
> <%- if @interface.virtual? && (([email protected]? && @subnet.has_vlanid?) ||
> @interface.vlanid.present?) -%>
> <%=   "VLAN=yes" %>
> <%- elsif @interface.virtual? && [email protected]? && [email protected]_vlanid? &&
> @interface.identifier.include?(':') -%>
> <%=   "TYPE=Alias" %>
> <%- end -%>


-- 
You received this message because you are subscribed to the Google Groups 
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to