static network configuration

Byron Pezan BPezan at secureworks.com
Tue Dec 20 12:26:56 UTC 2011


i usually pull the value of $static_ip from cobbler into a local variable first.  something like this:
-----
#set $static_ip = $getVar('$static_ip','')
-----

then reference the variable later like this:
-----
# Static network configuration.
...SNIP...
d-i netcfg/get_ipaddress string $static_ip
-----

depending on your use case, you might want to implement some logic to handle the occasion where $static_ip is not set with something like this:
-----
#if $getVar('$static_ip','') != ''
#set $static_ip = $getVar('$static_ip','')
...SNIP...
d-i netcfg/get_ipaddress string $static_ip
...SNIP...
#else
               ...SNIP...
               (something here to enable dhcp, maybe)
               ...SNIP...
#end if
-----

i'd recommend reading the 'kickstart templating' page on the wiki, particularly the sections about variables about halfway down the page:
https://github.com/cobbler/cobbler/wiki/Kickstart%20Templating


byron


From: cobbler-bounces at lists.fedorahosted.org [mailto:cobbler-bounces at lists.fedorahosted.org] On Behalf Of Kelly Goedert
Sent: Tuesday, December 20, 2011 5:12 AM
To: cobbler mailing list
Subject: static network configuration

Hi,

on my kickstart template I have this

# Static network configuration.
d-i netcfg/get_nameservers string 10.1.1.249
d-i netcfg/get_ipaddress string $static_ip
d-i netcfg/get_netmask string 255.0.0.0
d-i netcfg/get_gateway string 10.1.1.11
d-i netcfg/confirm_static boolean true

The static_ip value I have set on system -> kickstart metadata like

static_ip=10.1.1.8

But this config has no effect on the installation. What is wrong on this configuration? I am trying to install ubuntu 11.10

Thanks

Kelly
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://fedorahosted.org/pipermail/cobbler/attachments/20111220/5dd979ea/attachment.html>


More information about the cobbler mailing list