chef - using recipes from same cookbook
Asked Answered
A

1

5

I have cookbook base and cookbook myapp

base has 2 recipes - my_java and java_with_custom_stuff

in java_with_custom_stuff I want to use the recipe for my_java (same cookbook). something like

include_recipe 'my_java'

bash 'custom stuff' do
...
end

in myapp I do include_recipe "base::java_with_custom_stuff"

yet it complains that it cannot find my_java

Is there a way to use a recipe from the same cookbook?

Affiance answered 10/8, 2016 at 10:32 Comment(0)
P
12

include_recipe uses the first part every time as the cookbook name. So you have to specify the cookbook - name + recipe name:

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
Palpable answered 10/8, 2016 at 11:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.