Automating Red Hat installations quickly becomes essential if you have many machines to deploy. This is why the Kickstart method exists, allowing you to boot from virtually any media.
The kickstart file is where all the installation and configuration options are defined. I won’t describe all available options as they are well documented on the Red Hat website, but rather describe some interesting methods to achieve certain things that aren’t natively possible.
Here’s an example of a very standard kickstart file to give you an idea:
If you want to have the swap size equal to the RAM size, you’ll need to create a pre-script that stores the swap creation line in a temporary file. Then it will be called by the kickstart:
To install package groups in the packages section, you need to precede the package group name with @. For example, here’s how to get the list of available groups:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
> yum -v grouplist
Installed Groups:
Base (base) Compatibility libraries (compat-libraries) E-mail server (mail-server)[...]Available Groups:
[...] High Availability (ha) High Availability Management (ha-management)[...]Available Language Groups:
Afrikaans Support (afrikaans-support)[af][...]
If, for example, I want to add the High Availability group, I need to add this line:
default vesamenu.c32
#prompt 1timeout 600display boot.msg
menu background splash.jpg
menu title Welcome to Red Hat Enterprise Linux 6.2!
menu color border 0#ffffffff #00000000menu color sel 7#ffffffff #ff000000menu color title 0#ffffffff #00000000menu color tabmsg 0#ffffffff #00000000menu color unsel 0#ffffffff #00000000menu color hotsel 0#ff000000 #ffffffffmenu color hotkey 7#ffffffff #ff000000menu color scrollbar 0#ffffffff #00000000label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/ks.cfg
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset ks=cdrom:/ks.cfg
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local menu label Boot from ^local drive
localboot 0xffff
label memtest86
menu label ^Memory test kernel memtest
append -
Then add your kickstart file (ks.cfg) to the root of your iso (~/iso).