Red Hat System Administration II
Create a kickstart file and make it available to the installer.
Outcomes
Create a kickstart file.
Provide the kickstart file to the installer.
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-review
Instructions
Prepare a kickstart file on the serverb machine as specified, and provide it at the http://serverb.lab.example.com/ks-config/kickstart.cfg address.
On the
serverbmachine, copy the/root/anaconda-ks.cfgkickstart file to the/home/student/kickstart.cfgkickstart file to be editable for thestudentuser.Log in to the
serveramachine as thestudentuser.[student@workstation ~]$
ssh student@serverb...output omitted... [student@serverb ~]$On the
serverbmachine, copy the/root/anaconda-ks.cfgfile to the/home/student/kickstart.cfgfile.[student@serverb ~]$
sudo cat /root/anaconda-ks.cfg > ~/kickstart.cfg[sudo] password for student:student
Update the
/home/student/kickstart.cfgkickstart file.Comment out the
rebootcommand.Modify the
repocommand for the BaseOS and AppStream repositories. Modify therepocommand for the BaseOS repository to use thehttp://content.example.com/rhel9.3/x86_64/dvd/BaseOS/address. Modify therepocommand for the AppStream repository to use thehttp://content.example.com/rhel9.3/x86_64/dvd/AppStream/address.Change the
urlcommand to usehttp://content.example.com/rhel9.3/x86_64/dvd/as the installation source.Comment out the
networkcommand.Change the
rootpwcommand to setredhatas therootuser password.Modify the
authselectcommand to set thesssdservice as the identity and authentication source.Modify the
servicescommand to disable thekdumpandrhsmcertdservices and to enable thesshd,rngd, andchronydservices.Delete the
partcommands and add theautopartcommand.Simplify the %post section so that it runs only a script to append the text
Kickstarted onat the end of theDATE/etc/issuefile. Use thedatecommand to insert the date with no additional options.Simplify the
%packagesection as follows: include the@core,chrony,dracut-config-generic,dracut-norescue,firewalld,grub2,kernel,rsync,tar, andhttpdpackages. Ensure that theplymouthpackage does not install.
Comment out the reboot directive.
#reboot
Modify the
repocommand for the BaseOS and AppStream repositories. Modify therepocommand for the BaseOS repository to use thehttp://content.example.com/rhel9.3/x86_64/dvd/BaseOS/address. Modify therepocommand for the AppStream repository to use thehttp://content.example.com/rhel9.3/x86_64/dvd/AppStream/address.repo --name="BaseOS" --baseurl="http://content.example.com/rhel9.3/x86_64/dvd/BaseOS/" repo --name="Appstream" --baseurl="http://content.example.com/rhel9.3/x86_64/dvd/AppStream/"
Change the
urlcommand to specify the HTTP installation source media that theclassroommachine provides.url --url="http://content.example.com/rhel9.3/x86_64/dvd/"
Comment out the
networkcommand.#network --bootproto=dhcp --device=link --activate
Modify the
rootpwcommand to setredhatas the password for therootuser.rootpw --plaintext redhat
Modify the
authselectcommand to set thesssdservice as the identity and authentication source.authselect select sssd
Simplify the
servicescommand to match the following string.services --disabled="kdump,rhsmcertd" --enabled="sshd,rngd,chronyd"
Comment out the
partcommands and add theautopartcommand:# Disk partitioning information ignoredisk --only-use=vda #part biosboot --fstype="biosboot" --size=1 #part /boot/efi --fstype="efi" --size=100 --fsoptions="defaults,uid=0,gid=0,umask=077,shortname=winnt" #part / --fstype="xfs" --size=10137 --label=root autopart
Delete all content between the
%postand%endsections. Add theecho "Kickstarted on $(date)" >> /etc/issueline.%post --erroronfail echo "Kickstarted on $(date)" >> /etc/issue %end
Simplify the package specification to match the following content.
%packages @core chrony dracut-config-generic dracut-norescue firewalld grub2 kernel rsync tar httpd -plymouth %end
Validate the syntax of the
kickstart.cfgkickstart file.Provide the
/home/student/kickstart.cfgfile at thehttp://serverb.lab.example.com/ks-config/kickstart.cfgaddress.Copy the
kickstart.cfgfile to the/var/www/html/ks-config/directory.[student@serverb ~]$
sudo cp kickstart.cfg /var/www/html/ks-config/[sudo] password for student:studentReturn to the
workstationmachine as thestudentuser.[student@serverb ~]$
exitlogout Connection to serverb closed. [student@workstation ~]$