32.7. Post-installation Script
You have the option of adding commands to run on the system once the installation is complete. This section must be at the end of the kickstart file and must start with the %post
command. This section is useful for functions such as installing additional software and configuring an additional nameserver.
If you configured the network with static IP information, including a nameserver, you can access the network and resolve IP addresses in the %post
section. If you configured the network for DHCP, the /etc/resolv.conf
file has not been completed when the installation executes the %post
section. You can access the network, but you can not resolve IP addresses. Thus, if you are using DHCP, you must specify IP addresses in the %post
section.
Register the system to a Red Hat Network Satellite and log the output:
%post --log=/root/ks-post.log
wget -O- https://proxy-or-sat.example.com/pub/bootstrap_script | /bin/bash
/usr/sbin/rhnreg_ks --activationkey=<activationkey>
Run a script named runme
from an NFS share:
mkdir /mnt/temp
mount -o nolock 10.10.0.2:/usr/new-machines /mnt/temp
openvt -s -w -- /mnt/temp/runme
umount /mnt/temp
NFS file locking is not supported while in kickstart mode, therefore -o nolock
is required when mounting an NFS mount.