[英]Check if chef is running as chef-solo
我正在使用Vagrant和chef-solo来测试我的食谱,但我有一个特殊的食谱需要厨师服务器(它使用搜索)。 我希望我的默认配方如下所示:
include_recipe 'some_recipe'
include_recipe 'some_other_recipe'
unless running_as_chef_solo?
include_recipe 'a_recipe_that_requires_chef_server'
end
如何检查厨师是否在菜谱中作为厨师独奏运行,所以我可以跳过不支持的食谱?
使用Chef::Config
对象:
unless Chef::Config[:solo]
include_recipe 'a_recipe_that_requires_chef_server'
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.