this is obsolete doc -- see http://doc.nethence.com/ instead

Setting up Kickstart for RHEL7 and RHEL6 

 

http://pbraun.nethence.com/doc/net/ftpinstallsrv.html 

http://pbraun.nethence.com/doc/net/pxe.html 

http://pbraun.nethence.com/doc/security/ssh_cluster.html 

http://pbraun.nethence.com/doc/sysutils_linux/kickstart.html 

 

Install a new system using the [PXE boot server your configured previously](http://pbraun.nethence.com/unix/net/pxe.html). 

 

Send a copy of the anaconda configuration file to the install server, 

release=RHEL7
cp anaconda-ks.cfg $release.cfg.dist
scp $release.cfg.dist 10.8.8.1:/var/ftp/
^D

on srvinstall, 

cd /var/ftp/
release=RHEL7
cp $release.cfg.dist $release.cfg
vi $release.cfg

setup selinux, 

selinux --permissive

disable some services and the firewall, 

services --disabled=auditd,cups
firewall --disabled

create a user, 

python -c 'import crypt; print(crypt.crypt("My Password"))'
#no need to create group --name=GROUPNAME
user --name=USERNAME --iscrypted (paste here)

eventually add those packages to the %package stanza for RHEL7, 

ksh
elinks
lftp
mutt
ntp
open-vm-tools
screen
wget

eventually add those packages to the %package stanza for RHEL6 (same as above without open-vm-tools and add lynx and keep elinks), 

also setup YUM and EPEL (copy epel install rpm to srvinstall), 

%post
cd /etc/yum.repos.d/
cat > srvinstall <<EOF
[srvinstall]
name=srvinstall install server
baseurl=http://srvinstall/RHEL7/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
EOF

 

cd /root/
wget "http://10.8.8.1/epel-release-7-5.noarch.rpm"
rpm -ivh epel-release-7-5.noarch.rpm

 

cd /root/
cat > README <<EOF
- open-vm-tools up and running
- yum pointing to srvinstall + EPEL
- selinux disabled (permissive)
- firewalld disabled
EOF
%end

check the diffs, 

diff -u $release.cfg.dist $release.cfg

 

You can now use those boot parameters on RHEL7, 

label RHEL7 DANGEROUS AUTOMATED INSTALL keymap=fr
kernel RHEL7/vmlinuz
append initrd=RHEL7/initrd.img keymap=fr ip=dhcp inst.repo=http://10.8.8.1/RHEL7 ks=http://10.8.8.1/RHEL7.cfg cmdline

and those on RHEL6, 

label RHEL6 DANGEROUS AUTOMATED INSTALL keymap=fr
kernel RHEL6/vmlinuz
append initrd=RHEL6/initrd.img lang=us keymap=fr ip=dhcp method=http://10.8.8.1/RHEL6 ks=http://10.8.8.1/RHEL6.cfg text

See [there](http://pbraun.nethence.com/unix/net/pxe.html) for more information. 

 

Refs. 

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html 

CHAPTER 23. KICKSTART INSTALLATIONS: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-kickstart-installations.html 

Tips and tricks for anaconda and kickstart: https://wiki.centos.org/fr/TipsAndTricks/KickStart 

CHAPTER 6. INSTALLING USING ANACONDA: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installing-using-anaconda-x86.html 

RHEL7 text-only installation: http://unix.stackexchange.com/questions/120482/rhel7-text-only-installation 

RHCSA Series: Automate RHEL 7 Installations Using ‘Kickstart’ – Part 12: http://www.tecmint.com/automatic-rhel-installations-using-kickstart/ 

 

===================================== obsolete documentation =========================================== 

 

and change it accordingly for example (RHEL4 and RHEL5), 

install
nfs --server=NFS_SERVER --dir=/data/shared/centos5x64/CentOS-5.6-x86_64-bin-1of8_content/
lang en_US.UTF-8
keyboard us
#dhcp, network --device eth0 --bootproto=dhcp --hostname centos5x64
network --device eth0 --bootproto static --ip 192.168.0.99 --netmask 255.255.2555.0 --gateway 192.168.0.1 --nameserver 89.2.0.1,89.2.0.2 --hostname centos5x64.example.local
rootpw PASSWORD
firewall --disabled
selinux --disabled
authconfig --enableshadow --enablemd5
timezone --utc Europe/Paris
bootloader --location=mbr --driveorder=xvda --append="console=xvc0"
firstboot --disabled
clearpart --all --drives=xvda
part / --fstype ext3 --size=1024 --grow --ondisk=xvda --asprimary
part swap --fstype swap --size=2050 --ondisk=xvda --asprimary
poweroff

 

%packages --nobase
@core
portmap
yum
pdksh
openssh
openssh-server
#cvs not on first cdrom for both releases (rhel4 and 5)

 

#rhel4/xen,
#nfs --server=NFS_SERVER --dir=/data/shared/centos4x64/CentOS-4.8-x86_64-bin1of5_content/
#langsupport --default=en_US.UTF-8 en_US.UTF-8
#network [...] --hostname centos4x64
#
#%packages --nobase
#-kernel
#kernel-xenU
#e2fsprogs

note. on rhel4 lvm2 is already included by default (what group? I can't find it in comps.xml) 

note. rhel5 otherwise, 

#@base
#-autofs

note. change NFS_SERVER accordingly 

note. remove bootloader --append (only for xen guests) 

note. change xvda to hda or sda... 

note. for static ip, 

#network --device eth0 --bootproto static --ip 192.168.0.99 \
#       --netmask 255.255.255.0 --gateway 192.168.0.1 \
#       --nameserver 89.2.0.1 --hostname centos5x64

note. for an encrypted password, 

#rootpw --iscrypted ...

note. we would prefer to see the reboot prompt w/o the use of 'poweroff', but it's safer with virtualized guests, so you can take the chance to remove the extra kernel parameters (or the install would proceed again)... 

note. we do not need those default packages, 

#keyutils
#trousers
#fipscheck
#device-mapper-multipath

note. %packages --resolvedeps is now deprecated 

note. if you need to install only @core, 

#%packages --nobase

note. to remove packages from the selection, 

#-autofs

note. the trailing slash after nfs --dir may be needed with older RHEL4 

note. instead of NFS there's also HTTP, FTP and local harddrive as possible repos, 

#url --url http://<server>/<dir>
#url --url ftp://<username>:<password>@<server>/<dir>
#harddrive --partition=hdb2 --dir=/tmp/install-tree

note. you might get this bug at startup with recent rhels (https://bugzilla.redhat.com/show_bug.cgi?id=527726), 

failed to stat() /dev/mapper/{no,raid,disks}

 

refs. 

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-kickstart2-options.html 

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/s1-kickstart2-packageselection.html 

 

note. eventually add scripts within the kickstart before the installation, 

#%pre --interpreter /bin/ksh

note. eventually add scripts within the kickstart after the installation, 

#%post --interpreter /bin/ksh
#mkdir -p /mnt/nfs/
#mount -t nfs -o ro,nolock NFS_SERVER:/path/to/ /mnt/nfs/
#...
#umount /mnt/nfs/

 

 

Serving the kickstart file 

We need to make the kickstart file available either through NFS, HTTP or FTP e.g. on NFS_SERVER, 

/data/shared/centos5x64/base.ks

 

It's needed at boot time. 

 

 

Serving the RHEL repository 

Same for the RHEL repository e.g. on NFS_SERVER, 

/data/shared/centos5x64/CentOS-5.6-x86_64-bin-1of8_content/

 

It's needed during installation. If you have a really large number of servers to deploy, HTTP or FTP are prefered. 

 

 

Running kickstart 

Get to the boot loader prompt either by PXE, CDrom, USB key (images/diskboot.img) or xen guest extra= and add one of those kernel arguments at boot loader prompt, 

ip=dhcp noipv6 ks=nfs:NFS_SERVER:/data/shared/centos5x64/base.ks text

by FTP, 

#ip=dhcp noipv6 ks=ftp://FTP_SERVER/base.ks text

by floppy, 

#ip=dhcp noipv6 ks=hd:fd0/base.ks text

or just, 

#ks

note. if you want a static IP, 

#ip=IP netmask=NETMASK noipv6

note. other tips, 

#lang=en
#syslog=SYSLOG_SERVER
#console=ttyS0,38400n