Kickstart Keywords

Kickstart file keywords and Configuration

Kickstart Keywords and Parameters


Although Kickstart configuration files are generated automatically and reflect options chosen during an installation. To fully utilise kickstart, you will want to create these files either by hand or by using a special tool known as the "Kickstart Configurator". It is important to note that kickstart configuration sections must be specified in order. Items within these main sections do not have to be in a specified order. The main order of sections is as follows:


Command Section


Note: Mainly required options have been specified here. Items that are not required can be omitted.

If you have created a kickstart file that is missing one of the required keywords, then during the installation process you will be prompted to enter the required information, just as you would be be prompted during a typical installation. Once you have replied with the missing information, then the installation continues unattended. The required keywords have been included below along with some commonly used optional keywords.

Note: Lines starting with a hash/pound sign (#) are ignored and treated as comments.

Note: For a kickstart upgrade, the following items are required:

Language
Language Support
Installation Method
Device Specification (if device is needed to perform the installation)
Keyboard Setup
The upgrade keyword
Boot loader configuration


If any other items are specified for an upgrade, then those items are ignored (note that this includes package selections).



Kickstart: Required Keywords


auth or authconfig


Sets up the authentication options for your system. By default, passwords are normally encrypted and are not shadowed. The example below specifies that shadow passwords are used with the sha512 hashing algorithm.
authconfig --enableshadow --passalgo=sha512


bootloader


The bootloader keyword specifies how the boot loader should be installed. This option is required for installations and upgrades. The example below indicates that the bootloader is installed to the master boot record on drive sda.
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"


keyboard


Sets the default keyboard type for the system. The example below specifies a keyboard type of "uk".
keyboard uk


lang


Sets the language to use during installation and the default language to use on the installed system.
lang en_US.UTF-8


network - OPTIONAL


Although the network option is not classed as a required option. It is important to have a basic understanding of this keyword. If you need to manually specify network settings during a kickstart installation, then you can boot the system with the asknetwork option. This will prompt anaconda to ask you for your network settings rather than use the default settings (normally DHCP). The Anaconda installer will ask for this information before fetching the kickstart file. However, you can specify your options as per examples below.

An example of a DHCP network option: network --onboot no --device eth0 --bootproto dhcp --noipv6

An example of a static network: (Note: this is one continuous line)

network --device eth0 --bootproto static --ip 192.168.0.44 --netmask 255.255.255.0 --gateway 192.168.0.1 --nameserver 192.168.0.1 --hostname kicks01

The above specifies that the network interface is to be called "eth0", bootproto specifies that we will be using a static IP address. The other parameters are self explanatory.


part or partition (required for installs, ignored for an upgrade


Creates a partition on the system. For more information on this option see: Partitioning with Kickstart


repo (optional)


The repo command can be used to specify additional custom repositories. If repo is not specified, the base repositories should still be found from the installation media.

repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100


rootpw


Sets the system's root password to the "password" argument.

--iscrypted — If this is present, the password argument is assumed to already be encrypted.


timezone


Sets the system time zone to "timezone" which may be any of the time zones listed by timeconfig.

timezone --utc Europe/London


zerombr (optional)


If zerombr is specified any invalid partition tables found on disks are initialized. This destroys all of the contents of disks with invalid partition tables. This command is required when performing an unattended installation on a system with previously initialized disks. Although this is optional, if it is not specified and your disks have been used previously, then your unattended installation may stop and request that you manually select the reinitialize option. This command is simply specified by adding "zerombr" to the kickstart file. (Previously you had to specify zerombr yes, however, this has now been deprecated).



%packages section


Use the %packages command to select the packages you would like to install (this is for installations only, as package selection during upgrades is not supported). Individual packages are specified by giving their RPM name (excluding the version and platform information). Group packages are specified by @ symbol, a space, and then the full group name.

You can specify packages by group or by their package names. (Example below was taken from a CentOS 6.5 system)



%packages
@base
@console-internet
@core
@debugging
@basic-desktop
@directory-client
@general-desktop
@graphical-admin-tools
@hardware-monitoring
@internet-browser
@java-platform
@large-systems
@network-file-system-client
@performance
@perl-runtime
@server-platform
@server-policy
@workstation-policy
@x11
mtools
pax
oddjob
wodim
sgpio
genisoimage
device-mapper-persistent-data
samba-winbind
certmonger
pam_krb5
krb5-workstation
perl-DBD-SQLite
%end

Note that the Core and Base groups are always selected by default, so it is not necessary to specify them in the %packages section. Specify individual packages by name, one entry to a line. You can use an asterisk "*" as a wildcard to glob package names in entries. For example:



nfs*

The nfs* entry includes the packages nfs-utils, nfs-utils-lib and any others that match the specified pattern. You can also issue the command "yum grouplist" to display groups available. (This is done on an existing server).

A leading dash is used to specify packages or groups to be excluded from the installation. For example:



-@ Graphical Internet 
-autofs

--nobase
Do not install the @Base group. Use this option to perform a minimal installation, for example, for a single-purpose server or desktop appliance.


%pre section


Commands can be added to run immediately after the ks.cfg has been parsed. This section is placed towards the end of the kickstart configuration file. This section must start with the %pre command and end with the %end command. If your kickstart file also includes a %post section, the order of the %pre and %post sections does not matter.

The network can be accessed in the %pre section; however, only IP addresses will be accepted as the name service has not yet been configured at this point.


%post section


The "%post section" allows you to add commands that can run on the system once the installation has completed. This section must be placed towards the end of the kickstart file. This section must start with the %post command and end with the %end command. This section is useful for functions such as installing additional software and configuring an additional nameserver or even adding accounts.


Kickstart Documentation


As newer versions of Red Hat are shipped, certain commands will become deprecated and newer options will appear. The best place to keep track of these changes is to visit the official Red Hat documentation pages. These can be found at: Red Hat Documentation