Bookmark this page

Guided Exercise: Installing a System Using Kickstart

In this lab, you will create a Kickstart configuration file, confirm it is syntactically correct, and publish it for use.

Resources
Files: /root/anaconda-ks.cfg
Machines: desktopX

Outcomes

You will have a Kickstart configuration file based on the anaconda-ks.cfg file on desktopX. It will install packages from classroom.example.com, use DHCP for networking, partition storage and install packages according to specifications, and perform minor customization of the newly installed system.

  • Reset your desktopX system.

  • Log into and set up your desktopX system.

    [student@desktopX ~]$ lab kickstart setup
  1. Copy /root/anaconda-ks.cfg on desktopX to a file called kickstart.cfg that student can edit.

    [student@desktopX ~]$ sudo cat /root/anaconda-ks.cfg > kickstart.cfg
    
  2. Make the following changes to kickstart.cfg.

    1. Change the url command to specify the HTTP installation source media used in the classroom:

      url --url="http://classroom.example.com/content/rhel7.0/x86_64/dvd/"
    2. Configure the network to use DHCP. There should only be a single network directive that looks like the following:

      network --bootproto=dhcp
    3. Modify the disk configuration to only have the following three directives:

      # Clear the Master Boot Record
      zerombr
      # Partition clearing information
      clearpart --all --initlabel
      # Disk partitioning information
      part / --fstype="xfs" --ondisk=vda --size=5120
      

      Be sure the size is adjusted to 5120.

    4. Comment the reboot directive:

      #reboot
    5. Change the packages that are installed to include httpd, but not cloud-init. Simplify the package specification to look exactly like the following:

      @core
      chrony
      dracut-config-generic
      dracut-norescue
      firewalld
      grub2
      kernel
      rsync
      tar
      httpd
      -plymouth
      
    6. Delete all of the content in the %post section except for the following lines:

      %post --erroronfail
      # make sure firstboot doesn't start
      echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
      # append /etc/issue with a custom message
      echo "Kickstarted for class on $(date)" >> /etc/issue
      %end
      
    7. Set the root password to redhat. Change the line that starts with rootpw to:

      rootpw --plaintext redhat
  3. Use the ksvalidator command to check the Kickstart file for syntax errors.

    [student@desktopX ~]$ ksvalidator kickstart.cfg
    
  4. Copy kickstart.cfg to the /var/www/html/ks-config directory.

    [student@desktopX ~]$ sudo cp ~student/kickstart.cfg /var/www/html/ks-config
    
  5. Run the lab kickstart grading script on desktopX to confirm the specified changes have been made and the kickstart file is available via HTTP.

    [root@desktopX ~]# lab kickstart grade
    Kickstart file available via HTTP ..... PASS
    Confirming installation media ......... PASS
    Checking installed disk size .......... PASS
    Confirming network configuration ...... PASS
    Checking software package selection ... PASS
    
Revision: rh199-7-d0984a3