Kickstart your CentOS Template, EL7 Edition

I wrote an article on kickstarting your CentOS Template in early 2014 that focused on Enterprise Linux 6. Later in the year, RHEL7 was announced and CentOS 7 soon followed. It’s well past time to refresh the kickstart article. To keep this more of a “moving target”, I’ve created a github repo to host the kickstart files at puppetinabox/centos-kickstart, so you can turn there for updates or submit your own PRs. I’m also toying with an existing puppet module danzilio/kickstart that generates kickstart files, and I plan to contribute some PRs to it to manage the kickstart service itself. In the meantime, I’ll show a small profile that will do the same thing, since it’s just apache and a few files.

Kickstart Configuration

The new EL7 file was based off the EL6 version. I simply changed the package list as some were no longer available and the open-vm-tools are now the preferred method of VMware tools management. That section was removed from the bottom. In the additional steps section, I changed the yum repo for puppet from Puppet 3 to Puppet Collections 1 for Puppet 4. I also removed the banner setup, that’s easy enough to add in if you like.

Kickstart Service Management

The kickstart service itself is pretty simple. You can use puppetlabs-apache to install apache and then place your files in it’s default root of /var/www/html. Take the kickstart files and add them to dist/profile/files with any modifications you require. Then create a profile that includes apache plus the kickstart files. That would look something like this:

class profile::kickstart {
  # Manage the kickstart "service" which is simply apache
  include ::apache

    ensure => present,
    path   => '/var/www/html/el6-dhcp.ks',
    source => 'puppet:///modules/profile/files/el6-dhcp.ks',
    ensure => present,
    path   => '/var/www/html/el6-dhcp-with-tools.ks',
    source => 'puppet:///modules/profile/files/el6-dhcp-with-tools.ks',
    ensure => present,
    path   => '/var/www/html/el7-dhcp.ks',
    source => 'puppet:///modules/profile/files/el7-dhcp.ks',
  firewall { '100 HTTP/S inbound':
    dport  => [80, 443],
    proto  => tcp,
    action => accept,

Add that to a role with your base profile and anything else needed and classify a node with the role. Spin up the VM and run puppet and your files will be available.

If you are still supporting EL6 and want to use the tools, you will need to mount the vmwaretools.iso on your VM and copy the tarball to /var/www/html/vmwaretools.tgz. You could distribute this in your profile module, but it’s a 70M blob that will clog up your git repository, making it much larger and painful to move around. It seems a fair trade-off for this one-time manual step versus toting a giant blob along forever.

Creating the first VM

This is the easy part. With your kickstart server setup and ready to serve files, there are two steps left. Below I will assume the kickstart server has the address

First, download the netinstall iso from a mirror  (example) and upload it to your datastore or otherwise make it available for a VM. Create the VM. I used 1 vCPU, 512 M RAM, and a 60GB thin provisioned disk. The NIC was connected to the same network as my kickstart server and a DHCP server. Attach the netinstall iso and click Finish.

Second, start the VM and open the console. Hit escape to see the loader prompt and type in:

linux ks= ip=dhcp

Hit enter and go take your lunch break. When you return, you’ll have a VM running CentOS7 and Puppet 4!

[root@centostemplate ~]# uname -a
Linux 3.10.0-229.20.1.el7.x86_64 #1 SMP Tue Nov 3 19:10:07 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@centostemplate ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)
[root@centostemplate ~]# puppet --version
[root@centostemplate ~]#


You may have noticed that the kickstart file points the URL toward the CentOS mirrors, which means you’re downloading from the internet every time you use this. You can speed things up and make things more secure if you download the DVD  copy its contents to the kickstart node, perhaps at /var/www/html/CentOS. Change the URL and the repo to and the local contents will be used instead.

You should also be able to use this kickstart with other EL derivatives, including Red Hat. You may need to change the package names slightly as these often vary between vendors.

2 thoughts on “Kickstart your CentOS Template, EL7 Edition

  1. Pingback: Kickstart your CentOS Template, EL6 Edition | rnelson0
  2. Pingback: Puppet 4 Lessons Learned | rnelson0

Leave a Reply

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

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

Facebook photo

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

Connecting to %s