【发布时间】:2014-04-24 04:31:31
【问题描述】:
我正在尝试使用Opscode ntp cookbook,但使用它的说明对我来说没有任何意义。它说:
在角色中设置 ntp 属性。例如以
base.rb角色应用于所有节点:name 'base' description 'Role applied to all systems' default_attributes( 'ntp' => { 'servers' => ['time0.int.example.org', 'time1.int.example.org'] } )然后在应用于 NTP 服务器的
ntpserver.rb角色中(例如 time.int.example.org):name 'ntp_server' description 'Role applied to the system that should be an NTP server.' default_attributes( 'ntp' => { 'is_server' => 'true', 'servers' => ['0.pool.ntp.org', '1.pool.ntp.org'], 'peers' => ['time0.int.example.org', 'time1.int.example.org'], 'restrictions' => ['10.0.0.0 mask 255.0.0.0 nomodify notrap'] } )在这些角色中使用的 timeX.int.example.org 应该是内部 NTP 服务器的名称或 IP 地址。然后只需将 ntp 或 ntp::default 添加到 run_list 即可应用 ntp 守护进程的配置。
我们没有在我们的配置中使用角色。我们正在编写包含其他配方的配方,然后在我们尝试配置的主机上运行适当的配方。
如何在不使用角色的情况下使用说明书?
【问题讨论】:
标签: chef-infra