例如,如果我将这样的行追加到内核:
APPEND ks=http://192.168.1.100/cgi-bin/ks.cgi ip=dhcp
然后脚本ks.cgi可以确定它是什么主机(通过MAC地址),并打印出适合该主机的Kickstart选项.我可以选择通过将参数传递给脚本来覆盖一些选项,如下所示:
APPEND ks=http://192.168.1.100/cgi-bin/ks.cgi?NODETYPE=production&IP=192.168.2.80
在我们启动服务器之后,我们在此系统上激活Cfengine / Puppet并使用我们最喜欢的Configuration Management产品管理系统.
我们正在试验xCAT,但事实证明它过于繁琐.我已经调查了Cobbler,但我不确定它是否会这样做.
更新:
O’Reilly一书中讨论了自己动手的解决方案:Managing RPM-Based Systems with Kickstart and Yum,Chapter 3. Customizing Your Kickstart Install > Dynamic ks.cfg,其中回顾了此主题中的一些注释:
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=07004
In this example,the CGI (or servlet,or whatever) generates a ks.cfg for the machine server25.
但是哪里,哪里,ks.cgi的代码?
解决方法
Foreman使用红宝石模板,允许灵活的kickstart templating.