odedpr
odedpr

Reputation: 147

Include_recipe in chef is not working?

I'm not sure if it an issue or I'm missing something. I'm trying to figure out what is the different between include a recipe and mentioning it in a run list I have created 3 cookbooks :

  1. include_test - includes include_test1
  2. include_test1 - includes include_test2
  3. include_test2 - has a directory resource

When I try to run ( chef_client ) it while mentioning just "include_test" cookbook in the run_list the directory resource is not picked up

When I try to run it while mentioning "include_test,include_test1" cookbooks it is working as expected.

Is this the expected behavior?

Upvotes: 1

Views: 956

Answers (1)

coderanger
coderanger

Reputation: 54211

There is no major difference between a recipe being in the run list directly and being invoked by include_recipe. It does affect the value of node['recipes'] since for stuff in the run list it is statically expanded while include_recipe has to be processed as it happens. The usual issue with include_recipe failing is that you have to make sure to mark the cookbook you are including from as a dependency in your metadata.rb.

Upvotes: 0

Related Questions