[chef] Re: Re: all attributes files get evaluated?


Chronological Thread 
  • From: Johnny Tan < >
  • To:
  • Subject: [chef] Re: Re: all attributes files get evaluated?
  • Date: Fri, 1 Nov 2013 10:49:59 -0400

Thanks Sean.


On Thu, Oct 31, 2013 at 3:45 PM, Sean OMeara < " target="_blank"> > wrote:
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




  • [chef] Re: Re: all attributes files get evaluated?, Johnny Tan, 11/01/2013

Archive powered by MHonArc 2.6.16.

§