Bookmark this page

Lab: Install Red Hat Enterprise Linux

In this lab, you 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.

  1. On the serverb machine, copy the /root/anaconda-ks.cfg kickstart file to the /home/student/kickstart.cfg kickstart file to be editable for the student user.

    1. Log in to the servera machine as the student user.

      [student@workstation ~]$ ssh student@serverb
      ...output omitted...
      [student@serverb ~]$
    2. On the serverb machine, copy the /root/anaconda-ks.cfg file to the /home/student/kickstart.cfg file.

      [student@serverb ~]$ sudo cat /root/anaconda-ks.cfg > ~/kickstart.cfg
      [sudo] password for student: student
  2. Update the /home/student/kickstart.cfg kickstart file.

    • Comment out the reboot command.

    • Modify the repo command for the BaseOS and AppStream repositories. Modify the repo command for the BaseOS repository to use the http://classroom.example.com/content/rhel9.0/x86_64/dvd/BaseOS/ address. Modify the repo command for the AppStream repository to use the http://classroom.example.com/content/rhel9.0/x86_64/dvd/AppStream/ address.

    • Change the url command to use http://classroom.example.com/content/rhel9.0/x86_64/dvd/ as the installation source.

    • Comment out the network command.

    • Change the rootpw command to set redhat as the root user password.

    • Modify the authselect command to set the sssd service as the identity and authentication source.

    • Modify the services command to disable the kdump and rhsmcertd services and to enable the sshd, rngd, and chronyd services.

    • Delete the part commands and add the autopart command.

    • Simplify the %post section so that it runs only a script to append the text Kickstarted on DATE at the end of the /etc/issue file. Use the date command to insert the date with no additional options.

    • Simplify the %package section as follows: include the @core, chrony, dracut-config-generic, dracut-norescue, firewalld, grub2, kernel, rsync, tar, and httpd packages. Ensure that the plymouth package does not install.

    1. Comment out the reboot directive.

      #reboot
    2. Modify the repo command for the BaseOS and AppStream repositories. Modify the repo command for the BaseOS repository to use the http://classroom.example.com/content/rhel9.0/x86_64/dvd/BaseOS/ address. Modify the repo command for the AppStream repository to use the http://classroom.example.com/content/rhel9.0/x86_64/dvd/AppStream/ address.

      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/"
    3. Change the url command to specify the HTTP installation source media that the classroom machine provides.

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

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

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

      authselect select sssd
    7. Simplify the services command to match the following string.

      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="defaults,uid=0,gid=0,umask=077,shortname=winnt"
      #part / --fstype="xfs" --size=10137 --label=root
      autopart
    9. Delete all content between the %post and %end sections. Add the echo "Kickstarted on $(date)" >> /etc/issue line.

      %post --erroronfail
      echo "Kickstarted on $(date)" >> /etc/issue
      %end
    10. 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
  3. Validate the syntax of the kickstart.cfg kickstart file.

    1. Validate the Kickstart file for syntax errors.

      [student@serverb ~]$ ksvalidator kickstart.cfg
  4. Provide the /home/student/kickstart.cfg file at the http://serverb.lab.example.com/ks-config/kickstart.cfg address.

    1. Copy the kickstart.cfg file to the /var/www/html/ks-config/ directory.

      [student@serverb ~]$ sudo cp kickstart.cfg /var/www/html/ks-config/
      [sudo] password for student: student
    2. Return to the workstation machine as the student user.

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

Evaluation

As the student user on the workstation machine, use the lab command to grade your work. Correct any reported failures and rerun the command until successful.

[student@workstation ~]$ lab grade installing-review

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-review

This concludes the section.

Revision: rh134-9.0-fa57cbe