Bookmark this page

Guided Exercise: Automate Installation with Kickstart

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

  1. Log in to servera as the student user.

    [student@workstation ~]$ ssh student@servera
    ...output omitted...
    [student@servera ~]$
  2. 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
  3. Make the following changes to the /home/student/kickstart.cfg file.

    1. Comment out the reboot command:

      #reboot
    2. Modify the repo commands to specify the content server's BaseOS and AppStream repositories:

      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/"
    3. Modify the url command to specify the content server's HTTP installation source:

      url --url="http://content.example.com/rhel9.3/x86_64/dvd/"
    4. Comment out the network command:

      #network  --bootproto=dhcp --device=link --activate
    5. Modify the rootpw command to set the root user's password to redhat.

      rootpw --plaintext redhat
    6. Modify the authselect command to set the sssd service as the identity and authentication source.

      authselect select sssd
    7. Modify the services command to disable and enable services.

      services --disabled="kdump,rhsmcertd" --enabled="sshd,rngd,chronyd"
    8. 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
    9. 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
    10. 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
    11. Save and exit the file.

  4. Validate the Kickstart file for syntax errors. If no errors are shown, then the command has no output.

    [student@servera ~]$ ksvalidator kickstart.cfg
  5. Copy 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
  6. Return to the workstation machine as the student user.

    [student@servera ~]$ exit
    logout
    Connection to servera closed.
    [student@workstation ~]$

Finish

On the workstation machine, change to the student user home directory and use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish installing-kickstart

Revision: rh134-9.3-5fd2368