【发布时间】:2015-06-08 22:30:03
【问题描述】:
是否可以在如下食谱中引用厨师食谱的多个版本,其中一个食谱 (foo) 中的食谱引用另一食谱 (bar) 中的多个版本的食谱,其中版本变量在此块之前填充?
begin
case version
when ""
include_recipe "cookbook-bar"
when "1.0.0"
include_recipe "cookbook-bar@1.0.0"
when "1.0.1"
include_recipe "cookbook-bar@1.0.1"
else
raise "Invalid Version: " + version
end
rescue Chef::Exceptions::CookbookNotFound
raise "The Specified Cookbook Was Not Found: cookbook-foo-bar@" + version
end
在metadata.rb 文件中,我设置了如下所示的依赖项,希望能引入cookbook-bar 的1.0.0、1.0.1 和1.0.2 版本。
depends "cookbook-bar", "<= 1.0.2"
但是当我运行它时,对于1.0.0 和1.0.1 的cookbook-bar 版本,我仍然收到CookbookNotFound 错误。
【问题讨论】:
标签: chef-infra chef-recipe cookbook