Tuesday 31 May 2011

Kickstart Guide for RHEL

This post continued from PXE boot server setup but the propose of this is to create an automatic setup configure/script while install RHEL via PXE.
(refer to PXE boot server configure in previous post --> http://aflando.blogspot.com/2011/05/how-to-setup-pxe-boot-server-on-windows.html)

[Basic requirements]
1. Automatic install via NFS server(assume 192.168.8.184:/share/pxe already been shared)
2. Have a default value and let client click next to confirm or change it to own value.
3. Default value for keyboard, language and timezone.
4. Automatic add key(only AS5)
5. Start x windows on boot with GNOME
6. Interactive Network configuration
7. Firewall disabled (Not recommended)
8. Enable shadowed MD5 passwords
9. SELinux disabled (Not recommended)
10. Configure boot loader
11. Interactive disk layout
12. Automatic selecting package

[KickStart configuration]
/share/pxe/install/kickstart/ks.cnf file :

# RedHat Enterprise WS Kickstart configuration
## - - install type/source - - - - - - - - - - -
install
interactive
nfs --server=192.168.8.184 --dir=/share/pxe/32as4u8

## - - language and input support - - - - - - - -
lang en_US
keyboard us
timezone Asia/Bangkok

# enable X at boot time with GNOME as the default desktop
xconfig --startxonboot --defaultdesktop=GNOME

# for the install we get the IP address by DHCP
# AS4U8 network --device eth0 --bootproto dhcp
# AS5U6 network --bootproto=query
--noipv6
# AS6 xxxx
network --device eth0 --bootproto dhcp

firewall --disabled

# enable shadowed MD5 passwords
authconfig --enableshadow --enablemd5
selinux --disabled

## - - boot loader- - - - - - - - - -
bootloader --location=mbr

clearpart --all --initlabel

#For AS4U8 and AS5U6
%packages
@ X Window System
@ GNOME Desktop Environment
@ FTP Server
@ Legacy Network Server
@ Administration Tools
@ System Tools

#AS4U8 will not select telnet-server,Let post script do
#AS5U8 will auto-select

telnet-server

#Package section for AS6
#%packages
#@ X Window System
#@ Desktop
#@ FTP Server
#@ Networking Tools
#telnet
#telnet-server

# post-installation script starts
%post --interpreter /bin/sh

mkdir -p /mnt/tmp
mount 192.168.8.184:/share/pxe/32as4u8 -o ro /mnt/tmp
# run the top-level post-install script
# AS4U8 cd /mnt/tmp/RedHat/RPMS
# AS5U6 cd /mnt/tmp/Server
# AS6 cd /mnt/tmp/Server/Packages/
cd /mnt/tmp/RedHat/RPMS
rpm -ivf telnet-server*
cd /
# unmount the disk and delete the mount point
umount /mnt/tmp
rmdir /mnt/tmp

# enable telnet service
chkconfig telnet on
chkconfig vsftpd on
service xinetd restart
service vsftpd restart
mv /etc/securetty /etc/securetty.org
# post-installation script ends

[PXE boot server configuration]

Configure file C:\PXE\tftpboot\pxelinux.cfg\default
Example for AS4U8 :

label 32as4u8
menu label Install AS4U8 32bit
kernel /32as4u8/images/pxeboot/vmlinuz
append initrd=/32as4u8/images/pxeboot/initrd.img console=tty0 ks=nfs:192.168.8.184:/share/pxe/install/kickstart/32as4u8_ks.cfg ramdisk_size=268235456

No comments: