[chef] Re: Re: Chef 11 Attribute Changes -- Computed Attributes Edition


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Chef 11 Attribute Changes -- Computed Attributes Edition
  • Date: Tue, 6 Nov 2012 18:12:43 -0800


On Tuesday, November 6, 2012 at 6:07 PM, Phil Dibowitz wrote:

On Mon, Nov 05, 2012 at 04:07:29PM -0800, Daniel DeLeo wrote:
### Attributes Files and Recipes Have the Same Precedence

In Chef 10.x and previous, setting a default attribute value in a recipe
would overwrite a value set by a role or environment. In Chef 11, values
set from a cookbook are stored separately, so the value set by the role
or environment will not be overwritten.

Consider a role like this:

default_attributes "app_name" => "from-role"

And a recipe file like this:

node.default["app_name"] = "from-recipe"

In Chef 10.x and lower, the value of `node["app_name"]` will be
"from-recipe". In Chef 11, the value will be "from-role"

Wait, this is really bad. It's one thing to store them separately, but you're
1. changing predecence and 2. giving no way to override roles.

Since roles are non-static, that's REALLY bad. roles are upload-time static
data. The thing that can do dynmaic logic later on should absolutely have a
higher precedence. At read-time this should collapse the way it does now, and
I should get the recipe value.
In what cases do you use this behavior?

And, in the case of defaults, you can go to normal or override attributes if you must. Do you find yourself frequently overriding role overrides in recipes?
 

--
Open Source software and tech docs Insanity Palace of Metallica

"Be who you are and say what you feel, because those who mind don't matter
and those who matter don't mind."
- Dr. Seuss


-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§