加入收藏 | 设为首页 | 会员中心 | 我要投稿 我爱故事小小网_铜陵站长网 (http://www.0562zz.com/)- 视频终端、云渲染、应用安全、数据安全、安全管理!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

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

发布时间:2021-03-06 06:16:57 所属栏目:Linux 来源:网络整理
导读:我想要 Kickstart几台RHEL6 / SL6服务器.但是,其中一些服务器是不同的,我不想为每个类的服务器创建一个新的ks.cfg文件. 有什么方法可以动态生成Kickstart文件,从模板? 例如,如果我将这样的行追加到内核: APPEND ks=http://192.168.1.100/cgi-bin/ks.cgi

我想要 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.

(编辑:我爱故事小小网_铜陵站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读