Title: Customize a Kickstart File
Course: CIS 208: Linux/UNIX III: Intermediate System Administration, Networking, and Security ~ For IGNITE Review > Section: Learning Modules

Using a kickstart file, an installation of Linux can be preconfigured to select options such as the time zone, root password, how the disk will be partitioned, what packages will be selected and more.  If properly configured, a kickstart file can perform a "hands free" installation which can be automated.

The easiest way to prepare and edit a kickstart file is to use the system-config-kickstart program on system with a graphical environment.

yum install system-config-kickstart

Select the options to implement, and the selections for each.  Be sure to include a temporary password for the root account, since you will need to be able to login as root whether using the console or an ssh session.  If any required settings are not selected, the installer will be prompted for the selections during the installation.  Save the file in a secured location.

If needed, edit the file manually with vi or another editor.  Some options, such as alternate repositories, must be included manually.  See the documentation for kickstart files for more information.

Copy the kickstart file to the webserver, and create a new entry in the PXE menu.  For example, to create an option 4, add the following to /tftpboot/pxelinux.cfg/default.

label 4
kernel centos/6/x86_64/vmlinuz
append initrd=centos/6/x86_64/initrd.img ks=http://<ipaddr>/centos6-ks.cfg

Then add this line to /tftpboot/f1.txt.

[4] install Centos version 6 using kickstart

On a test server (such as a virtual machine), ensure that you are not prompted for the options you have selected.  If you are prompted for information, make your selections and complete the installation.  On the new installation, compare the file /root/anaconda-ks.cfg to your kickstart file.  The new or changed lines in the anacond-ks.cfg file can be added or updated in the kickstart file, and the boot process will not prompt for those items again.