Install and configure a Kickstart server with Cobbler on CentOS 6.4 (x86_64)

Note: Assume the Kickstart server’s IP is 192.168.1.254, DNS server is 192.168.1.253 and the IP range used for dhcp is 192.168.1.40 to 192.168.1.50.

Install EPEL

The EPEL RPM repository contains extra packages, such as Cobbler, for RHEL/CentOS.

==============EPEL=========http://fedoraproject.org/wiki/EPEL

Run the following:

# rpm -Uhv http://mirror.csclub.uwaterloo.ca/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

# yum install cobbler cobbler-web pykickstart system-config-kickstart dhcp mod_python wget tftp cman -y

# vi /etc/selinux/config

change:
SELINUX=enforcing
to:
SELINUX=disabled

# setenforce 0

# vi /etc/xinetd.d/tftp
edit:
disable                 = no

# vi /etc/xinetd.d/rsync
edit:
disable = no
flags           = IPv4

# service xinetd restart
# service httpd start

Starting httpd: httpd: Could not reliably determine the server’s fully qualified domain name, using

localhost.localdomain for ServerName

                                                          [  OK  ]

# vi /etc/httpd/conf/httpd.conf

 uncomment the following line:
#ServerName http://www.example.com:80

# service cobblerd start
# chkconfig xinetd on
# chkconfig httpd on
# chkconfig cobblerd on
# cobbler get-loaders
# vi /etc/cobbler/settings
edit the following lines accordingly:
next_server: 192.168.1.254
server: 192.168.1.254
pxe_just_once: 1
manage_dhcp: 1

# vi /etc/cobbler/dhcp.template
edit the file according to the following:
subnet 192.168.1.0 netmask 255.255.255.0 {
   option routers             192.168.1.1;
   option domain-name-servers 192.168.1.253;
   option subnet-mask         255.255.255.0;
   range dynamic-bootp        192.168.1.40 192.168.1.50;
   filename                   “/pxelinux.0”;
   default-lease-time         21600;
   max-lease-time             43200;
   next-server                192.168.1.254;
}

# iptables -F
# iptables -X
remember to configure iptables properly later!

 # service iptables restart
# cobbler check
Depending on personal requirements, perform the appropriate steps.

# service cobblerd restart
# cobbler sync
#cd /tmp
# wget http://centos.westmancom.com/5.9/isos/x86_64/CentOS-5.9-x86_64-bin-DVD-1of2.iso

In this case, I want cobbler to install CentOS 5.9 on other servers.

verify using md5sum

#md5sum CentOS-5.9-x86_64-bin-DVD-1of2.iso > md5.txt
#md5sum -c md5.txt
CentOS-5.9-x86_64-bin-DVD-1of2.iso: OK

# mount -o loop /tmp/CentOS-5.9-x86_64-bin-DVD-1of2.iso /mnt
# cobbler import –path=/mnt –name=CentOS5.9
# cobbler profile remove –name=CentOS5.9-i386
# cobbler profile remove –name=CentOS5.9-x86_64

# cp /root/anaconda-ks.cfg /var/lib/cobbler/kickstarts/centos59.ks

Configure the kickstart file:

# vi /var/lib/cobbler/kickstarts/centos59.ks

Delete all existing content and add the following.  You can edit these info according to your preferences:
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  –useshadow  –enablemd5
# System bootloader configuration
bootloader –append=”rhgb quiet” –location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart –all –initlabel
# Use text mode install
text
# Firewall configuration
firewall –enabled –http –ssh
# Run the Setup Agent on first boot
firstboot –disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging –level=info
url –url=http://192.168.1.254/cobbler/ks_mirror/CentOS5.9
# Network information
network –bootproto=dhcp –device=eth0 –onboot=on
# Reboot after installation
reboot
#Root password
rootpw –iscrypted $default_password_crypted
# SELinux configuration
selinux –enforcing
# Do not configure the X Window System
skipx
# System timezone
timezone  America/Toronto
# Install OS instead of upgrade
install
# Disk partitioning information
part /boot –asprimary –fstype=”ext3″ –ondisk=sda –size=500
part swap –fstype=”swap” –ondisk=sda –size=4096
part / –fstype=”ext3″ –grow –size=1 –ondisk=sda

%packages
@base
@core
@development-libs
@development-tools
@editors
@server-cfg
@system-tools
keyutils
iscsi-initiator-utils
trousers
fipscheck
device-mapper-multipath
perl-Convert-ASN1
imake
audit

 # cobbler profile add –name=CentOS5.9-x86_64 –distro=CentOS5.9-x86_64 –kickstart=/var/lib/cobbler/kickstarts/centos59.ks
#cobbler sync

sync starts dhcp

Reference
http://centoshowtos.org/installation/kickstart-cobbler-on-centos-server/

Advertisements
This entry was posted in Linux Admin Basics. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s