Table of Contents
Building a PXEboot kickstart server
In this, I'm going to document the process of creating an anaconda/kickstart server from scratch. This is all based on a CentOS 6.x server build. Unfortunately, I should have documented this some time ago when it was a little more fresh so if you run into issues in any part of this, please let me know at email@example.com.
As far as the machine I've set up goes, it is able to kickstart any machine anywhere as long as there is dhcp-relay set up on its VLAN. I'm going to first document the process/setup for PXEbooting on a private (RFC 1918) VLAN since it is a bit simpler. I will also include my scripts for adding/upgrading releases here as well since they will save you a great deal of time and tedium.
Just to note, the options for pulling kickstarts and transferring files (post tftp) are varied. You can use
http, etc. For the purposes of maximum compatibility, this documentation will walk you through the setup for using the
http method for everything.
Due to the nature of this subject, it will be assumed that you are familiar, and comfortable, with the linux command-line. I don't want to miss or gloss over anything, but I will assume better than basic skills. It is also assumed that you have a
CentOS machine already installed and running.
BIG HUGE NOTE: I'm only going to cover setting this up for
CentOS x86 and x86_64 builds for
CentOS 6.3, but this same server/setup can be used for Redhat kickstarts as well. You can also set up multiple release branches, such as
CentOS 5.8. The server I set up is actually doing this and it works very well. All it really takes is the addition of some more files and directories as well as some boot menu additions. I will leave that as an exercise for you if you need to be able to kickstart Redhat in addition to CentOS, but if you get snagged, you can email me and I'll try to help.
Let's get started.
First, there are a number of basic packages and configuration setups we need to do before really digging in. The first thing that I highly recommend is setting
Permissive is probably best as, if you want to use
enforcing mode, you can use the selinux tools to see where you have problems. See the selinux section if you need help with putting it in
I would also recommend, though I will briefly cover some of the rules to be set up, flushing all
iptables rules until you have a complete, working setup. Just like the notes about
selinux above, this will save a lot of potential headaches. You can lock your machine down after it works.
You will need some basic packages here in order for everything to work. As root (or using
yum install bind bind-utils dhcp httpd httpd-tools tftp tftp-server
If you've already turned off
selinux, skip this section.
permissive mode, first type the following on the command-line as root:
You should then get the following:
# getenforce Permissive
To make that “stick” after a reboot, open
/etc/sysconfig/selinux in your editor and make sure the
SELINUX variable is set to
permissive like this:
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=permissive
Set Up Your Directories
Now, we are going to set up some directories that will be populated as we move forward. By no means do you have to use the same paths that I'm using, but it's up to you to make sure that if you don't, you make the necessary config changes to reflect your paths.
As root (this should be obvious by now, and I will not mention again that you should be setting all this up as root):
mkdir -p /build/disks/centos/x86/6.3 mkdir -p /build/disks/centos/x86_64/6.3 mkdir -p /build/files/base mkdir -p /build/kickstart/common/base mkdir -p /build/kickstart/centos/x86/6.3 mkdir -p /build/kickstart/centos/x86_64/6.3 mkdir -p /tftpboot/images/centos/x86/6.3 mkdir -p /tftpboot/images/centos/x86_64/6.3