Provide a static ip on ubuntu

Hi,

I want use foreman to setup a static ip under ubuntu with preseed.

I use foreman 1.6.3

I found follow lines in template "Preseed default":

<% if @static -%>

Static network configuration.

d-i netcfg/disable_dhcp boolean true
d-i netcfg/get_ipaddress string <%= @host.ip %>
d-i netcfg/get_netmask string <%= @host.subnet.mask %>
d-i netcfg/get_nameservers string <%=
[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n|
n.blank?}.join(' ') %>
d-i netcfg/get_gateway string <%= @host.subnet.gateway %>
d-i netcfg/confirm_static boolean true
<% end -%>

to use "@static" I have to change safemode_render to false (Settings ->
Provisioning)

Then I change template "Preseed default PXELinux"
append initrd=<%= @initrd %> interface=auto url=<%=
foreman_url('provision')%>&static=true ramdisk_size=10800 root=/dev/rd/0
rw auto hostname=<%= @host.name %> <%= keyboard_params %> locale=<%=
@host.params['lang'] || 'en_US' %>

I enable Build for a host and check the pxe template:

url=http://foreman-url:80/unattended/provision?token=token-9fa7-4407-ad03-token&static=true

It looks fine.

If I review provision Template the "Static network configuration" (see
above) is not part of the provided preseed file. network lines are only:

Network configuration

d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string web221.adam.int.planetromeo.com
d-i netcfg/get_domain string adam.int.planetromeo.com
d-i netcfg/wireless_wep string

I tried to comment out "<% if @static -%>" but the static network part is still not part of the preseed file.

Which steps are needed to provide a static network config via provisioning for ubuntu systems?

Viele Gruesse,
thomas.

Hi Thomas

did you find a solution. I have the same Problem. Provisioning CentOS works
fine for static IP. But not for ubuntu.

best
Gunnar

ยทยทยท Am Mittwoch, 17. Dezember 2014 18:05:13 UTC+1 schrieb tp: > > Hi, > > I want use foreman to setup a static ip under ubuntu with preseed. > > > I use foreman 1.6.3 > > I found follow lines in template "Preseed default": > > <% if @static -%> > # Static network configuration. > d-i netcfg/disable_dhcp boolean true > d-i netcfg/get_ipaddress string <%= @host.ip %> > d-i netcfg/get_netmask string <%= @host.subnet.mask %> > d-i netcfg/get_nameservers string <%= > [@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n| > n.blank?}.join(' ') %> > d-i netcfg/get_gateway string <%= @host.subnet.gateway %> > d-i netcfg/confirm_static boolean true > <% end -%> > > > to use "@static" I have to change safemode_render to false (Settings -> > Provisioning) > > Then I change template "Preseed default PXELinux" > append initrd=<%= @initrd %> interface=auto url=<%= > foreman_url('provision')%>*&static=true* ramdisk_size=10800 > root=/dev/rd/0 rw auto hostname=<%= @host.name %> <%= keyboard_params %> > locale=<%= @host.params['lang'] || 'en_US' %> > > > I enable Build for a host and check the pxe template: > > url=http://foreman-url:80/unattended/provision?token=token-9fa7-4407-ad03-token&static=true > > > It looks fine. > > If I review provision Template the "Static network configuration" (see > above) is not part of the provided preseed file. network lines are only: > > # Network configuration > d-i netcfg/choose_interface select auto > d-i netcfg/get_hostname string web221.adam.int.planetromeo.com > d-i netcfg/get_domain string adam.int.planetromeo.com > d-i netcfg/wireless_wep string > > I tried to comment out "<% if @static -%>" but the static network part is still not part of the preseed file. > > > Which steps are needed to provide a static network config via provisioning for ubuntu systems? > > > Viele Gruesse, > thomas. > > > > > > > > >