Kickstart Examples – Configuration 5

Kickstart Examples – Configuration 5

Networking:
  • Bootproto = static
  • Hostname = centvm1
  • IP = 192.168.122.200
  • Netmask = 255.255.255.0
  • Gateway = 192.168.122.1
  • Nameserver = 192.168.122.1
  • Disable IPv6
Partitioning:
  • /boot –ext4 –size 500M
  • LVM paritioning
  • Volume Group – size 7G
  • Logical volume – lv_root – size 5G
  • Logical volume – lv_swap – size 1.5G
General:
  • SELinux enabled
  • Firewall rule added for SSH
  • TimeZone – Europe/London
  • CentOS Minimal – Core
  • Add a user named testuser
  • Install httpd package and enable & start the service

Kickstart config

# =======================================
# SECTION 1: Command section
# =======================================
# Install options
install
url --url ftp://192.168.122.249/images/centos/x86_64/6.5
keyboard uk
lang en_US
selinux --enforcing
timezone --utc Europe/London

# Set up root password
rootpw --iscrypted $6$jgrdXC4a/XBlOZkv$A49cH1mwaK7K91.EM/GDdiFO7NBt4CXk3omKntDk35UEyzjWBeJl2x6oGPuH0HRYLjJNUhYDsHRjyEGjsMFp50

# Create an user with encrypted password
user --name=testuser --password=$6$jgrdXC4a/XBlOZkv$A49cH1mwaK7K91.EM/GDdiFO7NBt4CXk3omKntDk35UEyzjWBeJl2x6oGPuH0HRYLjJNUhYDsHRjyEGjsMFp50 --iscrypted

# Networking options
network --onboot yes --device eth0 --bootproto static --ip 192.168.122.200 --netmask 255.255.255.0 --gateway 192.168.122.1 --nameserver 192.168.122.1 --hostname centvm1 --noipv6

# Authentication options
authconfig --enableshadow --passalgo-sha512

# Bootloader options
# Harddisk in this case is /dev/vda
zerombr
bootloader --location=mbr --driveorder=vda --append="crashkernel=auto"

# Add an exception for ssh in firewall
firewall --service=ssh

# Partitioning
clearpart --all --initlabel
part /boot --fstype=ext4 --size=500
part pv.001 --size 7000
volgroup my_volgp pv.001
logvol / --fstype=ext4 --vgname=my_volgp --size=5000 --name=lv_root
logvol swap --fstype=swap --vgname=my_volgp --size 1500 --name=lv_swap

# Reboot after installation
reboot

# =======================================
# SECTION 2: Packages section
# =======================================
%packages --nobase
@Core
httpd

# =======================================
# SECTION 3: Pre section (optional)
# =======================================

# =======================================
# SECTION 4: Post section (optional)
# =======================================
%post
chkconfig httpd on
service httpd start