I try to provision a vm machine with an alias/virtual Interface like eth0:1.
So far so good. After the first build and the final Callback to Foreman I
get an Exception in the foreman log so that the "wget" command to finish
build cancels.
> ActionView::Template::Error: The snippet 'preseed_networking_setup'
threw an error: undefined method 'physical_device' for Nic::Base::Jail
(Nic::Managed)
> /usr/share/foreman/lib/foreman/renderer.rb:87:in `rescue in snippet'
I stop build mode manuall directly in foreman. When I try to restart the
build I got that Message from foreman in the webgui as popup before I can
force the build.
Failure parsing Preseed default finish DemoVM : The snippet
'preseed_networking_setup' threw an error: undefined method
'physical_device' for Nic::Base::Jail (Nic::Managed).
In the Snippet "preseed_networking_setup" I found this
<% @host.managed_interfaces.each do |interface| %>
<% next if !interface.managed? || interface.subnet.nil? ||
interface.primary -%>
<% subnet = interface.subnet -%>
<% virtual = interface.virtual? -%>
<% dhcp = subnet.nil? ? false : subnet.dhcp_boot_mode? -%>
real=ip -o link | grep <%= interface.mac -%> | awk '{print $2;}' | sed s/:$//
<% if virtual -%>
real=echo <%= interface.identifier -%> | sed s/<%=* interface.physical_device* -%>/$real/
<% end -%>
But what's the correct Method for interface.physical_device?
> Hi,
>
> I try to provision a vm machine with an alias/virtual Interface like eth0:1.
> So far so good. After the first build and the final Callback to Foreman
> I get an Exception in the foreman log so that the "wget" command to
> finish build cancels.
>
[…]
> In the Snippet "preseed_networking_setup" I found this
>
> <% @host.managed_interfaces.each do |interface| %>
> <% next if !interface.managed? || interface.subnet.nil? ||
> interface.primary -%>
> <% subnet = interface.subnet -%>
> <% virtual = interface.virtual? -%>
> <% dhcp = subnet.nil? ? false : subnet.dhcp_boot_mode? -%>
> real=ip -o link | grep <%= interface.mac -%> | awk '{print $2;}' | sed > s/:$//
> <% if virtual -%>
> real=echo <%= interface.identifier -%> | sed > s/<%=*interface.physical_device* -%>/$real/
> <% end -%>
>
> But what's the correct Method for interface.physical_device?
···
On Fri, Oct 14, 2016 at 01:14:38AM -0700, Tom K. wrote:
> I try to provision a vm machine with an alias/virtual Interface like eth0:1.
> So far so good. After the first build and the final Callback to Foreman I
> get an Exception in the foreman log so that the "wget" command to finish
> build cancels.
>
> > ActionView::Template::Error: The snippet 'preseed_networking_setup'
> threw an error: undefined method 'physical_device' for Nic::Base::Jail
> (Nic::Managed)
Perfect!
But there are still some other errors. Will report @github
Thanks.
– Tom
···
Am Freitag, 14. Oktober 2016 11:29:31 UTC+2 schrieb Dominic Cleal:
>
> On 14/10/16 09:14, Tom K. wrote:
> > Hi,
> >
> > I try to provision a vm machine with an alias/virtual Interface like
> eth0:1.
> > So far so good. After the first build and the final Callback to Foreman
> > I get an Exception in the foreman log so that the "wget" command to
> > finish build cancels.
> >
> [..]
> > In the Snippet "preseed_networking_setup" I found this
> >
> > <% @host.managed_interfaces.each do |interface| %>
> > <% next if !interface.managed? || interface.subnet.nil? ||
> > interface.primary -%>
> > <% subnet = interface.subnet -%>
> > <% virtual = interface.virtual? -%>
> > <% dhcp = subnet.nil? ? false : subnet.dhcp_boot_mode? -%>
> > real=`ip -o link | grep <%= interface.mac -%> | awk '{print $2;}' | sed
> > s/:$//`
> > <% if virtual -%>
> > real=`echo <%= interface.identifier -%> | sed
> > s/<%=*interface.physical_device* -%>/$real/`
> > <% end -%>
> >
> > But what's the correct Method for interface.physical_device?
>
> It should probably be interface.attached_to, it was renamed back in
> Foreman 1.7.0. If it works for you, please do send a fix to
>
> https://github.com/theforeman/community-templates/blob/develop/snippets/preseed_networking_setup.erb.
>
>
> --
> Dominic Cleal
> dom...@cleal.org
>