RH134 Ch 10: Automating Installs with Kickstart
Kickstart answers every question the installer would ask, so a machine can be built without anyone at the console. The installer itself writes one for each system it installs: /root/anaconda-ks.cfg is the best starting template.
Structure. A kickstart file has a command section, then sections that each end with %end:
text lang enUS.UTF-8 keyboard --vckeymap=us timezone Asia/Kolkata rootpw --iscrypted $6$… network --bootproto=static --device=eth1 --ip=172.25.250.20 --netmask=255.255.255.0 --gateway=172.25.250.254 --nameserver=172.25.250.254 --hostname=serverc.lab.example.com ignoredisk --only-use=vda clearpart --all --initlabel autopart --type=lvm reboot
%packages @^minimal-environment vim-enhanced %end
%post echo "Provisioned by WebAsha" /etc/motd %end
@^name installs an environment group, @name a group and -name excludes a package. %pre runs before partitioning; %post runs in the installed system after packages, ideal for last configuration steps.
Passwords. Never ship plain text: create a hash with openssl passwd -6 (or python3 -c 'import crypt…') and use rootpw --iscrypted. user --name=… --groups=wheel --iscrypted --password=… adds a user.
Validation. The pykickstart package provides ksvalidator, which parses the file exactly as the installer would and reports the line of each error. Use -v RHEL10 to check against the right syntax version; ksverdiff lists commands that changed between versions.
Delivery. Publish the file on a web or NFS server and boot the installer with inst.ks=http://server/ks/serverc.ks, or put it on a volume labelled OEMDRV. The Red Hat Hybrid Cloud Console can also generate kickstart files.
Common exam mistakes - Missing %end on a section. - Misspelt options, which stop an unattended install halfway. - Not validating before copying the file to the install server.