【问题标题】:chef - using recipes from same cookbook厨师 - 使用同一食谱中的食谱
【发布时间】:2016-08-16 23:40:00
【问题描述】:

我有食谱 base 和食谱 myapp

base 有 2 个配方 - my_javajava_with_custom_stuff

java_with_custom_stuff 中,我想使用my_java 的食谱(相同的食谱)。像

include_recipe 'my_java'

bash 'custom stuff' do
...
end

myapp 我愿意 include_recipe "base::java_with_custom_stuff"

但它抱怨找不到my_java

有没有办法使用同一本食谱中的食谱?

【问题讨论】:

    标签: ruby chef-infra chef-recipe cookbook


    【解决方案1】:

    include_recipe 每次都使用第一部分作为菜谱名称。所以你必须指定食谱 - 名称+食谱名称:

    include_recipe '::my_java' # works still after you rename your cookbook
    include_recipe 'base::my_java' # works only as long as your cookbook name is base
    

    【讨论】:

      猜你喜欢
      • 2019-01-29
      • 1970-01-01
      • 2021-11-01
      • 2017-04-27
      • 2015-05-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-04
      • 2013-11-03
      相关资源
      最近更新 更多