繁体   English   中英

使用自定义 ohai 插件的运行列表中的食谱顺序

[英]order of cookbooks in run-list using a custom ohai plugin

我有一本包含自定义 ohai 插件的 wapper 食谱。 这个插件用在我的第二本食谱中。 我的 config.rb 文件是否正确?

cookbook_path [
    '/home/user/.chef/cookbooks',   #<< ohai cookbook
    '/home/user/cookbooks'          #<< wrapper cookbook (ohai plugin) and second cookbook
]

ohai.plugin_path += [
   '/home/user/cookbooks/ohai/plugins'
]

ohai.directory '/home/user/cookbooks/ohai/plugins'

带有 ohai 插件的包装食谱是否必须在第二本食谱之前的运行列表中?

更新:

当我更新自定义 ohai 插件属性并运行 Chef-client 时,更新后的 ohai 插件会复制到指定位置 /etc/chef/ohai/plugins 但日志信息仍显示以前的值。

include_recipe 'ohai'

ohai 'reload' do
  plugin 'example'
  action :nothing
end

cookbook_file "#{node['ohai']['plugin_path']}/example.rb" do
  source 'example.rb'
  notifies :reload, 'ohai[reload]', :immediately
end

test = "#{node['ohai']['example']}"
log test 

使用ohai 资源加载自定义插件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM