[chef] When is it necessary to use include_attribute?


Chronological Thread 
  • From: Christopher Armstrong < >
  • To:
  • Subject: [chef] When is it necessary to use include_attribute?
  • Date: Thu, 27 Mar 2014 10:01:24 -0700

Ohai Chefs,

Say I have a cookbook bar. This cookbook depends on a cookbook foo. I have included foo as a dependency in my metadata.rb and I'm doing an include_recipe "foo" in bar's default recipe. Groovy.

I need to override a few of foo's default attributes in bar. So, in bar's attributes.rb, I override these attributes.

Now my question: ordinarily, I would include_attributes "foo" in bar before I override these attributes, as alphabetically foo comes after bar, and I want to ensure that those attributes are parsed before I override them. 

That's how I've been doing things. Today, though, I'm wondering if that's even necessary, because I have listed foo as a dependency in bar's metadata. Does Chef's dependency resolver parse default attributes for all dependencies before getting to a cookbook's own attributes?

Hope that makes sense!

Thanks,

Chris



Archive powered by MHonArc 2.6.16.

§