Kickstart: Serve dynamic kickstart images via a CGI or PHP script?

Posted by Stefan Lasiewski on Server Fault See other posts from Server Fault or by Stefan Lasiewski
Published on 2011-10-18T23:58:18Z Indexed on 2012/10/10 21:41 UTC
Read the original article Hit count: 277

Filed under:
|
|

I'd like to kickstart a couple dozen RHEL6/SL6 servers. However, some of these servers are different and I don't want to create a new ks.cfg file for each class of server.

Are there any products which can generate a Kickstart file dynamically on the fly, from a template?

For example, if I append a line like this to the KERNEL:

APPEND ks=http://192.168.1.100/cgi-bin/ks.cgi 

Then the script ks.cgi can determine what host this is (Via the MAC address), and print out Kickstart options which are appropriate for that host. I could optionally override some options by passing parameters to the script, like this:

APPEND ks=http://192.168.1.100/cgi-bin/ks.cgi?NODETYPE=production&IP=192.168.2.80

After we kickstart the server, we activate Cfengine/Puppet on this system and manage the system using our favorite Configuration Management product.

We're experimenting with xCAT but it is proving too cumbersome. I've looked into Cobbler, but I'm not sure it does this.

Update:

A roll-your-own solution is discussed in the O'Reilly book: Managing RPM-Based Systems with Kickstart and Yum, Chapter 3. Customizing Your Kickstart Install > Dynamic ks.cfg, which echos some of the comments in this thread:

To implement such a tool is beyond the scope of this Short Cut, but I can walk through the high-level design. Any such solution would mix a data store (the things that change) with a templating solution (the things that don’t change). The data store would hold the per-machine data, such as the IP address and hostname. You would also need a unique identifier, perhaps the hostname, such that you could pick up a given machine’s data. The data store could be a flat file, XML data, or a relational database such as PostgreSQL or MySQL.

In turn, to invoke the system, you pass a machine’s unique identifier as a URL parameter. For example:

boot: linux ks=http://your.kickstart.server/gen_config?host-server25

In this example, the CGI (or servlet, or whatever) generates a ks.cfg for the machine server25.

But where, oh where, is the code for ks.cgi?

© Server Fault or respective owner

Related posts about redhat

Related posts about kickstart