[chef] Re: all attributes files get evaluated?


Chronological Thread 
  • From: Sean OMeara < >
  • To: " " < >
  • Subject: [chef] Re: all attributes files get evaluated?
  • Date: Thu, 31 Oct 2013 15:45:41 -0400

Hi Johnny.

Yes, all attribute files from all cookbooks get loaded in the chef-client run.
Best practice is to namespace them in the hashes.

default['cookbookname']['possibly_even_recipe_name']['foo'] = "bar"

-s


On Thu, Oct 31, 2013 at 2:27 PM, Johnny Tan < " target="_blank"> > wrote:
Are _all_ attribute files evaluated for all nodes in the same cookbook? (Assuming no conditionals that would exclude.)

For some reason, we thought we could have different "role recipes" that included different attribute files, rather than setting the attributes inside the recipe. But it wasn't working, and this page seems to confirm that all attribute files would be evaluated even if you're not intentionally "including" them:

If that's the case, what's the best practice here? To _only_ put default values in any attributes file, and then set role differences inside role recipes? (We're starting to move to role recipes, but we might have several roles within the same cookbook, so we were hoping to set each role's attributes with a different attributes file.)

Thanks,
johnny




Archive powered by MHonArc 2.6.16.

§