Hello ! I can't figure out how to provision additional interfaces from ERB
template with Foreman 1.7.
I try to use this code for network in my centos KS template :
network --bootproto=static --ip=<%= @host.ip %> --netmask=<%=
@host.subnet.mask %> --gateway=<%= @host.subnet.gateway %> --nameserver=<%=
@host.subnet.dns_primary %> --device=eth0 --hostname=<%= @host.shortname %>
–noipv6
<% if !@host.interfaces.managed.empty? -%>
<% @host.interfaces.managed.each do |interface| -%>
network --bootproto=static --ip=<%= interface.ip %> --netmask=<%=
interface.subnet.mask %> --device=<%= interface.identifier %> --noipv6
<% end -%>
<% end -%>
I want to provison a new host using vSphere compute resource, in network
tab i add one or two additional interfaces specifying type (interface),
identifier (eth1 or eth2), the subnet and an ip address.
When i submit host creation, it works with no error, but if i edit the
host, in network tab all informations regarding additional interfaces are
gone, only primary interface information remains.
Once host has rebooted and after first puppet run, additional interfaces
informations are back in host edit mode.
I need these informations during provisioning, why are additional
interfaces informations deleted ?
Thx for your help.
Nobody's provisioning hosts with additional interfaces ?
Need help on this plz.
Ty
···
Le vendredi 30 janvier 2015 11:15:11 UTC+1, Alexandre Barth a écrit :
>
> Any idea about this ?
>
> Thx.
>
> Le jeudi 29 janvier 2015 11:45:10 UTC+1, Alexandre Barth a écrit :
>>
>> Hello ! I can't figure out how to provision additional interfaces from
>> ERB template with Foreman 1.7.
>>
>> I try to use this code for network in my centos KS template :
>>
>> network --bootproto=static --ip=<%= @host.ip %> --netmask=<%=
>> @host.subnet.mask %> --gateway=<%= @host.subnet.gateway %> --nameserver=<%=
>> @host.subnet.dns_primary %> --device=eth0 --hostname=<%= @host.shortname %>
>> --noipv6
>> <% if !@host.interfaces.managed.empty? -%>
>> <% @host.interfaces.managed.each do |interface| -%>
>> network --bootproto=static --ip=<%= interface.ip %> --netmask=<%=
>> interface.subnet.mask %> --device=<%= interface.identifier %> --noipv6
>> <% end -%>
>> <% end -%>
>>
>> I want to provison a new host using vSphere compute resource, in network
>> tab i add one or two additional interfaces specifying type (interface),
>> identifier (eth1 or eth2), the subnet and an ip address.
>>
>> When i submit host creation, it works with no error, but if i edit the
>> host, in network tab all informations regarding additional interfaces are
>> gone, only primary interface information remains.
>> Once host has rebooted and after first puppet run, additional interfaces
>> informations are back in host edit mode.
>>
>> I need these informations during provisioning, why are additional
>> interfaces informations deleted ?
>>
>> Thx for your help.
>>
>>
>>
Finally i found a solution : have to specify a fake mac address in order to
keep interfaces recorded during built time. Fake mac addresses are updated
by puppet facts with correct values after first puppet run.
But as i'm using a compute resource to provision virtual machine, i should
not have to provide a mac address in this case.
···
Le lundi 2 février 2015 16:54:17 UTC+1, Alexandre Barth a écrit :
>
> Nobody's provisioning hosts with additional interfaces ?
>
> Need help on this plz.
>
> Ty
>
> Le vendredi 30 janvier 2015 11:15:11 UTC+1, Alexandre Barth a écrit :
>>
>> Any idea about this ?
>>
>> Thx.
>>
>> Le jeudi 29 janvier 2015 11:45:10 UTC+1, Alexandre Barth a écrit :
>>>
>>> Hello ! I can't figure out how to provision additional interfaces from
>>> ERB template with Foreman 1.7.
>>>
>>> I try to use this code for network in my centos KS template :
>>>
>>> network --bootproto=static --ip=<%= @host.ip %> --netmask=<%=
>>> @host.subnet.mask %> --gateway=<%= @host.subnet.gateway %> --nameserver=<%=
>>> @host.subnet.dns_primary %> --device=eth0 --hostname=<%= @host.shortname %>
>>> --noipv6
>>> <% if !@host.interfaces.managed.empty? -%>
>>> <% @host.interfaces.managed.each do |interface| -%>
>>> network --bootproto=static --ip=<%= interface.ip %> --netmask=<%=
>>> interface.subnet.mask %> --device=<%= interface.identifier %> --noipv6
>>> <% end -%>
>>> <% end -%>
>>>
>>> I want to provison a new host using vSphere compute resource, in network
>>> tab i add one or two additional interfaces specifying type (interface),
>>> identifier (eth1 or eth2), the subnet and an ip address.
>>>
>>> When i submit host creation, it works with no error, but if i edit the
>>> host, in network tab all informations regarding additional interfaces are
>>> gone, only primary interface information remains.
>>> Once host has rebooted and after first puppet run, additional interfaces
>>> informations are back in host edit mode.
>>>
>>> I need these informations during provisioning, why are additional
>>> interfaces informations deleted ?
>>>
>>> Thx for your help.
>>>
>>>
>>>
Hey, glad you found a workaround. The networking part of Foreman is
getting a substantial rewrite in 1.8. Hopefully, the new system should
work better for you once that's released. You can learn more about the
new features here: https://www.youtube.com/watch?v=xmYmMQONq_0
Greg