我正在尝试使用 cookbook,但是关于使用它的说明对我来说没有任何意义。上面写着:
在角色中设置ntp属性。例如,在应用于所有节点的
base.rb角色中: 名称'base‘description’角色应用于所有系统‘default_attributes’( 'ntp‘=> {’服务器‘=> 'time0.int.example.org','time1.int.example.org’}) 然后,在应用于NTP服务器的ntpserver.rb角色(例如,time.int.example.org)中: 命名为“ntp_server‘description’角色,应用于应该是NTP服务器的系统。”default_attributes( 'ntp‘=> {’ntp 'is_server‘=> 'true',’服务器‘’0.info.gov.hk.ntp.org‘,’1.info.gov.hk.ntp.org‘,’对等‘=> 'time0.int.example.org','time1.int.example.org',’=> '10.0.0.0掩蔽255.0.0.0掩蔽了255.0.0.0个命名陷阱‘}) 这些角色中使用的timeX.int.example.org应该是内部NTP服务器的名称或IP地址。然后简单地向run_list添加ntp,或ntp::default以便应用ntp守护进程的配置。
我们在配置中不使用角色。我们正在编写包含其他菜谱的菜谱,然后在我们试图提供的主机上运行相应的菜谱。
我怎样才能不用角色来使用食谱呢?
发布于 2014-04-23 20:31:31
您可以开发一本包装食谱,它设置节点属性,然后包含菜谱。这类包装食谱的示例菜谱如下所示:
# Set the node attributes for ntp
node.default['ntp']['servers'] = ['time0.int.example.org', 'time1.int.example.org']
# include the recipe
include_recipe 'ntp'https://stackoverflow.com/questions/23254479
复制相似问题