Automating Installation with Kickstart





Automating Installation with Kickstart

Both Fedora and Red Hat Linux save all the parameters you used during installation in the /root/anaconda-ks.cfg Kickstart configuration file. You can use this file to create an automated installation of a duplicate system, which can be useful if you have a large number of servers to install.

This section shows you how to automate network installations using the Kickstart application and NFS. You can use HTTP and FTP, but I omitted them to keep the discussion brief.

How to Create New Kickstart Configuration Files

You can create a customized Kickstart configuration file by using the ksconfig command from a GUI console. It brings up a menu from which you can select all your installation options. When finished, you save the configuration with the filename of your choice.

You may want to then edit the configuration file, adding # signs to comment out certain parameters that may change from system to system, including the system's name and IP address. During the Kickstart process you will be prompted for these unspecified values.

Note

Do not change the order of the entries in the Kickstart configuration file.


Note

The IP address you assign must be on the same subnet as that of the DHCP server for Kickstart to work. If the server is going to reside on a different network after the installation, then you'll have to run a separate script to change the IP addressing information after the installation is complete.


Adding post Installation Commands

You may want to run some commands on the newly created Linux installation after Kickstart is complete. Some processes that Fedora activates by default may not be suitable for your server and may need to be disabled. You can disable them by placing a %post section at the end of the Kickstart file with all the post installation commands you wish to run. For example:

     %post
     chkconfig isdn off
     chkconfig pcmcia off
     chkconfig portmap off
     chkconfig apmd off
     chkconfig nfslock off
     chkconfig nfs off

A Note about Using anaconda-ks.cfg

It is possible to use the /root/anaconda-ks.cfg file as a template for future installations. Fedora comments out the partitioning information in this file, so you have to uncomment it and then make your partitioning modifications or be prepared to be prompted for your portioning information.

How to Run a Kickstart Installation

It is best to place your Kickstart files in a subdirectory under the /data/network-install directory. The upcoming examples assume the subdirectory is called /data/network-install/kickstart. Remember that you may want to remove the # comments from the partition section of the file. If not, you will be prompted for this information.

When using a NFS server, verify that the first two lines of the file look like this:

     install
     nfs --server=192.16.1.100 --dir=/data/network-install/ISO

If they don't you may be prompted for NFS ISO file location information.

When using a Web server, verify that the first two lines of the file look like this:

     install
     url --url http://192.168.1.100/network-install/

If they don't, you may be prompted for RPM base file location information.

Booting With Your Kickstart Files

There are two ways to specify the name of the Kickstart file to use. The first is to enter it manually from the boot: prompt when you insert the boot CD. The second is to have your DHCP server automatically tell the Kickstart client the name of the Kickstart file when the server assigns the IP address.

Manually Specifying the Kickstart Filename

After you boot from your boot CD-ROM, you need to issue a command at the boot: prompt to continue with the installation. The ks.cfg file is the Kickstart configuration file you want to use, but the command syntax changes depending on whether you choose NFS or HTTP. For the NFS method, use:

     boot: linux ks=nfs:192.168.1.100:/kickstart/ks.cfg

For the HTTP method, use:

     boot: linux ks=http://192.168.1.100/network-install/kickstart/ks.cfg

Configuring the Filename Automatically

Whenever you have to create lots of cloned Linux servers, you may want to configure your DHCP server to specify the single Kickstart configuration file you wish to use. Here is how it's done:

1.
Place your Kickstart file in the /data/network-install/kickstart directory.

2.
Edit your dhcpd.conf file, and add the following lines to the section for the interface that will be serving DHCP IP addresses. The next-server value is the IP address of the Kickstart server.

filename "/data/network-install/kickstart/ks.cfg";
next-server 192.168.1.100;

3.
Insert the boot CD into the Kickstart client Linux box, and connect it to the DHCP network. At the boot: prompt type:

boot: linux ks

Kickstart first searches for a configuration file named ks.cfg on the boot CD. It then automatically attempts to get a DHCP IP address and see if the DHCP server will specify a configuration file.

Kickstart next uses NFS to get both the configuration file and the installation ISOs. The rest should be automatic.


     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows