Kickstart is used to perform an automated installation where no manual intervention would be needed but there are times when we want the end user to fill in some needed details for eg keyboard type, network details etc so kickstart must wait and prompt for these information before the installation is completed.
Here I have written an article to automate a customized DVD installation using kickstart file
How to create customized bootable boot ISO image in RHEL/CentOS 7
Now suppose in the same DVD installation you want the installation to halt and prompt for network.
This can be done using the %pre and %post installation scripts from the kickstart file.
# vim ks.cfg --- --- --- # Network Information %include /tmp/network.ks -- -- -- # Create a %pre section as below %pre --interpreter=/usr/bin/bash exec < /dev/tty6 > /dev/tty6 2> /dev/tty6 chvt 6 read -p "Enter INS hostname : " HOSTNAME read -p "Enter IP Address : " IPADDR read -p "Enter NetMask : " NETMASK read -p "Enter Gateway : " GATEWAY echo sleep 1 echo "network --bootproto=static --hostname=$HOSTNAME --device=eth0 --gateway=$GATEWAY --ip=$IPADDR --netmask=$NETMASK --noipv6 --nodns --onboot=on --activate" > /tmp/network.ks chvt 1 exec < /dev/tty1 > /dev/tty1 2> /dev/tty1 %end
Here we are halting the automated installation, switching to terminal 6 and prompting user for hostname and network details and the same is populated into "/tmp/network.ks"
which is added as in the ks.cfg
%include /tmp/network.ks
I have tested these steps in Red Hat 6 and 7 and seems to work very well.
Seems to work in RHEL8 as well.
Hi Charles. Did you run into any issues with the server still pulling in a DHCP IP?
Network device isn’t always eth0, this seems to work:
Also hostname is being read but still needs to be applied, adding this fixes that for me:
Thanks
Thank you for sharing this
lets suppose i want to have a menu for hard disk partitioning based on user input like 1 for X disk partition scheme and 2 for Y disk parition scheme to be followed by only one kickstart file. what to do ??