Automating the OS install options with kickstart – Installing with and without Automation Magic

Automating the OS install options with kickstart

The kickstart file is one of the most important parts of the automated install process. This file contains all the information required to automatically install and configure the OS. The kickstart file is a simple text file that contains the directions to allow an unattended installation.

Getting ready

In order to work with kickstart files, you will need somewhere to build the system, such as Oracle VM VirtualBox. This system can be used to create your first kickstart file, as well as testing new kickstart files before moving them into the PXE environment.

Note

Anaconda is the Oracle Linux installer. It can operate via an automated install using a kickstart file, or interactively via a graphic or text install interface.

How to do it…

While you can manually create a file from scratch, it is much easier to start with the file that Anaconda creates on installation. This kickstart file is created automatically when a manual is installed and saved on the new system in /root/anaconda-ks.cfg. This file can be easily edited and reused for future builds. Let’s look at the file by breaking it down into smaller sections. This system is a graphical installation. Other options are text or cmdline:

Note

There are many options for kickstart, and they are listed in Appendix – kickstart options.
#version=OL8
# Use graphical install
graphical

The repo used to install Oracle Linux was a directory that was loopback mounted from an ISO file. baseurl can also be an HTTPS server, an NFS location, or an FTP server. For example, –baseurl=https://pxe.m57.local/ol8 will tell kickstart to pull the RPMs from a web server:
repo –name=”AppStream” –baseurl=file:///run/install/sources/mount-0000-cdrom/AppStream

The packages are the software packages selected. Names starting with an @ sign are package groups, and lines without @ are individual packages. Also, the ^ symbol is used to enable the installation of only the required packages in a group. If ^ is not set, all packages in the group are installed. In this example, the graphical-server-environment package group RPMs are installed as well as the kexec-tools package:


%packages
@^graphical-server-environment
kexec-tools
%end

This is where the default keyboard and language are selected:
# Keyboard layouts
keyboard –xlayouts=’us’
# System language
lang en_US.UTF-8

This is the hostname for the new server. Ideally, it should be the Fully Qualified Domain Name (FQDN) for the system:


# Network information
network  –hostname=ol802.lab.m57.local

This is used to select a CD-ROM or a CD-ROM mounted on a filesystem as the installation media:


# Use CDROM installation media
cdrom

This is used to run the setup agent on the first boot:


# Run the Setup Agent on first boot
firstboot –enable

Here, the install disk is selected, as well as the configuration of the logical volume manager and filesystems:
ignoredisk –only-use=sda
# Partition clearing information
clearpart –none –initlabel
# Disk partitioning information
part /boot –fstype=”xfs” –ondisk=sda –size=1024
part pv.116 –fstype=”lvmpv” –ondisk=sda –size=80868
volgroup ol –pesize=4096 pv.116
logvol /home –fstype=”xfs” –size=5120 –name=home –vgname=ol
logvol / –fstype=”xfs” –size=51200 –name=root –vgname=ol
logvol /u01 –fstype=”xfs” –size=10240 –name=u01 –vgname=ol
logvol /var –fstype=”xfs” –size=5120 –name=var –vgname=ol
logvol swap –fstype=”swap” –size=4056 –name=swap –vgname=ol
logvol /var/log –fstype=”xfs” –size=5120 –name=var_log –vgname=ol

Leave a Reply

Your email address will not be published. Required fields are marked *

All Rights Reserved 2022-2024