redhat – Kickstart:通过CGI或PHP脚本提供动态kickstart图像?

前端之家收集整理的这篇文章主要介绍了redhat – Kickstart:通过CGI或PHP脚本提供动态kickstart图像?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想要 Kickstart几台RHEL6 / SL6服务器.但是,其中一些服务器是不同的,我不想为每个类的服务器创建一个新的ks.cfg文件.

有什么方法可以动态生成Kickstart文件,从模板?

例如,如果我将这样的行追加到内核:

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的代码

解决方法

由于您已经在使用puppet,因此您还可以查看 Foreman以获得高级kickstart模板.

Foreman使用红宝石模板,允许灵活的kickstart templating.

原文链接:https://www.f2er.com/linux/397785.html

猜你在找的Linux相关文章