How does Foreman provision NICs?

Hello all,

I am trying to understand how does foreman configure NICs during Kickstart
phase. I am adding two NICs.
My template (I've added the snippet network inside the template):

<%#
kind: provision
name: My Kickstart default
oses:.


skipx

<% subnet = @host.subnet -%>
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
<% dhcp = subnet.dhcp_boot_mode? && !@static -%>
<% else -%>
<% dhcp = !@static -%>
<% end -%>

Configured real NIC: [<%= @host.ip %>]

network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select(&:present?).join(',')}" %> --device=<%= @host.mac -%> --hostname <%= @host %>

rootpw --iscrypted <%= root_pass %>

my Preview:

skipx

Configured real NIC: [*******]

network --bootproto static --ip=***** --netmask=255.255.255.0 --gateway=***** --nameserver=, --device=*****:69 --hostname .

rootpw --iscrypted $…

And on my provisioning node anaconda-ks.cfg:

Kickstart file automatically generated by anaconda.

#version=DEVEL
install
url --url=http://*****/centos/6.6/os/x86_64
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --mtu=1500 --bootproto static --ip ****
–netmask 255.255.255.0 --gateway **** --nameserver , --hostname
.

network --onboot yes --device eth1 --bootproto dhcp --noipv6 --hostname

··· ******* rootpw --iscrypted $6....... # System services . . . Where does the second 'network' line is added? I was thinking that the NIC is provisioned in the network snippet.

Hello,

I'm not sure I understand your question, partly because email probably broke
the output and make it hard to read. Maybe use pastie next time. Anyway a
generic answer is that network snippet creates config files on interfaces
(/etc/sysconfig/network-scripts) in %post section of kickstart template. Some
of these interfaces might be skipped, e.g. when they are unmanaged ("managed"
checkbox is not checked).

When you use provisiong template, they are not brought up automatically, since
the host will reboot soon anyway. If you use finish template, networking is
restarted just after configuration.

Hope this helps

··· -- Marek

On Monday 23 of March 2015 08:49:02 Lev Michael wrote:

Hello all,

I am trying to understand how does foreman configure NICs during Kickstart
phase. I am adding two NICs.
My template (I’ve added the snippet network inside the template):

<%#
kind: provision
name: My Kickstart default
oses:.


skipx

<% subnet = @host.subnet -%>
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
<% dhcp = subnet.dhcp_boot_mode? && !@static -%>
<% else -%>
<% dhcp = !@static -%>
<% end -%>

Configured real NIC: [<%= @host.ip %>]

network --bootproto <%= dhcp ? ‘dhcp’ : “static --ip=#{@host.ip}
–netmask=#{subnet.mask} --gateway=#{subnet.gateway}
–nameserver=#{[subnet.dns_primary,
subnet.dns_secondary].select(&:present?).join(’,’)}” %> --device=<%=
@host.mac -%> --hostname <%= @host %>

rootpw --iscrypted <%= root_pass %>

my Preview:

skipx

Configured real NIC: [*******]

network --bootproto static --ip=***** --netmask=255.255.255.0
–gateway=***** --nameserver=, --device=*****:69 --hostname .

rootpw --iscrypted $…

And on my provisioning node anaconda-ks.cfg:

Kickstart file automatically generated by anaconda.

#version=DEVEL
install
url --url=http://*****/centos/6.6/os/x86_64
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --mtu=1500 --bootproto static --ip ****
–netmask 255.255.255.0 --gateway **** --nameserver , --hostname
.

network --onboot yes --device eth1 --bootproto dhcp --noipv6 --hostname


rootpw --iscrypted $6…

System services

.
.
.
Where does the second ‘network’ line is added? I was thinking that the NIC
is provisioned in the network snippet.


Marek