In this lab, you create a kickstart file and validate the syntax.
Outcomes
Create a kickstart file.
Validate the kickstart file's syntax.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
This command prepares your environment and ensures that all required resources are available.
[student@workstation ~]$ lab start installing-kickstart
Instructions
Log in to servera as the student user.
[student@workstation ~]$ ssh student@servera
...output omitted...
[student@servera ~]$Create the /home/student/kickstart.cfg file by copying the contents of the /root/anaconda-ks.cfg file using privileged access.
[student@servera ~]$sudo cat /root/anaconda-ks.cfg > ~/kickstart.cfg[sudo] password for student:student
Make the following changes to the /home/student/kickstart.cfg file.
Comment out the reboot command:
#reboot
Modify the repo commands to specify the classroom server's BaseOS and AppStream repositories:
repo --name="BaseOS" --baseurl="http://classroom.example.com/content/rhel9.0/x86_64/dvd/BaseOS/" repo --name="Appstream" --baseurl="http://classroom.example.com/content/rhel9.0/x86_64/dvd/AppStream/"
Modify the url command to specify the classroom server's HTTP installation source:
url --url="http://classroom.example.com/content/rhel9.0/x86_64/dvd/"
Comment out the network command:
#network --bootproto=dhcp --device=link --activate
Modify the rootpw command to set the root user's password to redhat.
rootpw --plaintext redhat
Modify the authselect command to set the sssd service as the identity and authentication source.
authselect select sssd
Modify the services command to disable and enable services.
services --disabled="kdump,rhsmcertd" --enabled="sshd,rngd,chronyd"
Comment out the part commands and add the autopart command:
# Disk partitioning information ignoredisk --only-use=vda #part biosboot --fstype="biosboot" --size=1 #part /boot/efi --fstype="efi" --size=100 --fsoptions="..." #part / --fstype="xfs autopart
Delete all of the content between the %post section and its %end directive.
Add the echo "Kickstarted on $(date)" >> /etc/issue line.
%post --erroronfail echo "Kickstarted on $(date)" >> /etc/issue %end
Modify the %packages section to include only the following content:
%packages @core chrony dracut-config-generic dracut-norescue firewalld grub2 kernel rsync tar httpd -plymouth %end
Save and exit the file.
Validate the Kickstart file for syntax errors. If no errors are shown, then the command has no output.
[student@servera ~]$ ksvalidator kickstart.cfgCopy the kickstart.cfg file to the /var/www/html/ks-config directory.
[student@servera ~]$sudo cp ~/kickstart.cfg /var/www/html/ks-config[sudo] password for student:student
Return to the workstation machine as the student user.
[student@servera ~]$ exit
logout
Connection to servera closed.
[student@workstation ~]$This concludes the section.