厨师 - 使用同一食谱的食谱

Nic*_*nto 4 ruby cookbook chef-infra chef-recipe

我有食谱base和食谱myapp

基地有2个食谱 - my_javajava_with_custom_stuff

java_with_custom_stuff我想要使​​用食谱my_java(相同的食谱).就像是

include_recipe 'my_java'

bash 'custom stuff' do
...
end
Run Code Online (Sandbox Code Playgroud)

myapp我做 include_recipe "base::java_with_custom_stuff"

但它抱怨它找不到 my_java

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

slo*_*k2k 10

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
Run Code Online (Sandbox Code Playgroud)