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.
Kickstart File
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:
# Kickstart file# Minimal installation for production usage# Made by Deimos# Install instead of upgradeinstall
# Use text mode installtext
# Use CDROM installation mediacdrom
# Installation logging levellogging--level=info
# System keyboardkeyboardus
# System languagelangen_US
# Disable firewallfirewall--disabled
# SELinux configurationselinux--disabled
# Root passwordrootpw--iscrypted$1$6qaKy76d$R8ToaKxZD4Q89pJWrpE/y.
# System authorization informationauth--useshadow--passalgo=sha512
# Do not configure the X Window Systemskipx
# System timezonetimezone--isUtcEurope/Paris
# Network informationnetwork--bootproto=dhcp--device=eth0--onboot=on
# System bootloader configurationbootloader--location=mbr
# Clear the Master Boot Recordzerombr
# Partition clearing informationclearpart--all--initlabel
# Disk partitioning informationpart/boot--fstype="ext4"--size=512partpv.os--size=65536--grow
partswap--size=1000--maxsize=2000volgroupvgospv.os
logvol/--vgname=vgos--name=root--size=8096logvol/var--vgname=vgos--name=var--size=8096logvol/home--vgname=vgos--name=home--size=32768# Packages installation%packages
@base
%end
# Reboot after installationreboot
Swap = RAM
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: