[英]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.