Matt Baker wrote:
Hello Michael,
The system was added to cobbler using the following command:
cobbler system add --profile=CentOS-5.1-x86_64 --interface=0
--ip=x..x.x.1 --mac=00:x:x:x:9A:F8 --gateway=x.x.x.254 --interface=1
--name=00:x:x:x:9A:F9
This is fine, in fact, interface=0 is the default, so you don't need
to specify it. You can have any number of interfaces listed here
(well, up to 8 currently), and you do not need to enter all of them
into Cobbler, just the ones that you need to show up in the PXE Linux
tree and possibly for DHCP reservations.
I assume the "x's" are just to not share the full details here and
aren't literal.
Correct, I just removed the real life IP's from habit. The build network
(eth1) are from private IP address space, and the eth0 interface IP's
are public IP space.
where the IP x.x.x.1 is on the public interface (ethernet addr
00:x:x:x:9A:F8)
and ethernet 00:x:x:x:9A:F9 is on the build network interface
Is this the "right" way to go about this, or should I instead be
modifying profiles/ks files?
You need to do both. If you have two network interfaces, your
kickstart needs two network lines.
Basically you can use variables like $ip_address_intf0 and so forth in
there to automate filling those in if you like, or just putting in two
lines to tell both interfaces to dhcp. You might also be able to
indicate the other interface should not be used there also.
I'd also recommend looking into ksdevice=link for kernel options.
Ah, that's the hint I think I needed - and have now found the section in
the wiki. I was not understanding the use of the $ip_address_intf0
variable. Obviously I wanted to keep the ks files as generic as possible
(all the systems are pretty much built the same), with just the IP's
changing. using the 'cobbler system add' seemed the best way to do this.
Matt,
I wrote a kickstart snippet that automates the network section of the
kickstart file. Let me dig it out...
Put this in /var/lib/cobbler/snippets/network_config:
# Network information
#for $n in $range(7)
#set $ns = str($n)
#if $getVar('mac_address_intf' + $ns, '')
#if $getVar('ip_address_intf' + $ns, '')
#set $network_stanza = \
'--bootproto=static' \
+ ' --ip=' + $getVar('ip_address_intf' + $ns, '') \
+ ' --netmask=' + $getVar('subnet_intf' + $ns, '<not found>') \
+ ' --gateway=' + $getVar('gateway_intf' + $ns, '<not found>')
#else
#set $network_stanza = '--bootproto=dhcp'
#end if
#if $getVar('hostname_intf' + $ns, '')
#set $hostname_stanza = '--hostname=' + $getVar('hostname_intf' +
$ns, '')
#else
#set $hostname_stanza = ''
#end if
network $hostname_stanza $network_stanza --device=eth$n --onboot=on
#end if
#end for
HTH,
R.
_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools