Using variables in kickstart file
Gabrie
thegabeman at gmail.com
Wed Jul 18 22:02:50 UTC 2007
Ok... let me give it a try.
commandline:
boot: yadda yadda yadda ESXIP=10.0.0.20 ESXVMOTION=10.0.2.20
Kickstart.cfg:
# Regional Settings
keyboard us
lang en_US
langsupport --default en_US
timezone America/New_York
# Installatition settings
skipx
mouse none
firewall --disabled
# Unencrypted root password: password
rootpw --iscrypted $1$5a17$In5zYe6YsCty76AycpGaf/
reboot
install
url --url http://192.168.3.150/esx/esx301/
# network configuration
%include /tmp/networkinfo
# Partitioning
clearpart --all --drives=cciss/c0d0 --initlabel
part /boot --fstype ext3 --size 250 --ondisk=cciss/c0d0
part swap --size 1600 --ondisk=cciss/c0d0
part / --fstype ext3 --size 5120 --ondisk=cciss/c0d0
part /var --fstype ext3 --size 2048 --ondisk=cciss/c0d0
%pre
# Read ESXIP and ESXVMOTION from commandline
ESXIP=`awk -F "ESXIP=" '{print $2}' /proc/cmdline | cut -d " " -f 1`
ESXVMOTION=`awk -F "ESXVMOTION=" '{print $2}' /proc/cmdline | cut -d " " -f 1`
# Now write them to file:
cat << EOF >> /tmp/networkinfo
# Network Configurations
network --device eth0 --bootproto static --ip $ESXIP --netmask 255.255.255.0
#EOF
Any good?
Gabrie
More information about the Kickstart-list
mailing list