# Sample scripted installation file
# edited and updated by vallard@sumavi.com

# Accept the VMware End User License Agreement
vmaccepteula

# Set the root password for the DCUI and Tech Support Mode
rootpw --iscrypted #CRYPT:passwd:key=vmware,username=root:password#

# clear all partitions.
clearpart --alldrives --overwritevmfs
# Choose the first disk (in channel/target/lun order) to install onto
autopart --firstdisk --overwritevmfs

# The install media is on the network.
install url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch#


# Set the network to DHCP on the first network adapter
#network --bootproto=dhcp --device=vmnic0
network --bootproto=dhcp

# reboot automatically when we're done.
reboot

# A sample post-install script
%post --interpreter=busybox --unsupported --ignorefailure=true

# tell xCAT management server we are done installing
# have to put in the IP address instead of the hostname because VMware
# ESXi 4.1 can not resolve IP addresses...
echo "<xcatrequest>\n<command>nextdestiny</command>\n</xcatrequest>" | /bin/openssl s_client -quiet -connect #COMMAND: host #TABLE:noderes:$NODE:xcatmaster# | head -1 |  sed 's/.*address//g' #:3001 2>&1 | tee /tmp/foo.log

# enable SSH on next boot:
%firstboot --interpreter=busybox --unsupported --level=47
sed -ie 's/#ssh/ssh/' /etc/inetd.conf #ssh is too nice not to have
