- From: bradford <
>
- To:
- Subject: [chef] Re: Re: precedence is different, so why are values merged
- Date: Tue, 18 Sep 2012 14:59:55 -0400
I am still a little confused. Perhaps someone could improve the docs
a bit? More clarification is needed on when merging takes place. Is
it always, unless you specify "!merge:"? How do the
default_attributes, normal_attributes, and override_attributes fit in
with the precedence? The person I was talking to on IRC said he was
bit by the same thing. Or maybe it's just me and I am simply just
reading through the docs too fast.
On Tue, Sep 18, 2012 at 12:43 AM, Scott Kaminski
<
>
wrote:
>
I have encountered this exact problem before, when I was setting both
>
override and default attributes at the environment level.
>
>
Array merging is covered here for roles/environments:
>
http://wiki.opscode.com/display/chef/Deep+Merge
>
>
I ended up changing that setting to:
>
default['ntp']['servers']=Array.new
>
>
Otherwise I ended up with an array list and setting of:
>
pool.ntp.org,pool2,ntp.org,myserver.whatever.com,mysecondserver.whaterver.com
>
>
>
Thanks,
>
>
>
>
>
On Mon, Sep 17, 2012 at 6:05 PM, bradford
>
<
>
>
wrote:
>
> ntp has the following in attributes/default.rb:
>
>
>
> default['ntp']['servers'] = %w{ 0.pool.ntp.org 1.pool.ntp.org
>
> 2.pool.ntp.org 3.pool.ntp.org }
>
>
>
> i added the following to my development.rb:
>
>
>
> default_attributes( "ntp" => { "servers" =>
>
> ["0.north-america.pool.ntp.org", "1.north-america.pool.ntp.org"] })
>
>
>
> but i see all 6 of them in ntp.conf. on irc someone said that when
>
> the precedence is the same, they get merged; but, according to the
>
> docs [1] the precedence is not the same:
>
>
>
> The precedence of the attributes - from low to high
>
>
>
> default attributes applied in an attributes file
>
> default attributes applied in an environment
>
> default attributes applied in a role
>
> default attributes applied on a node directly in a recipe
>
> normal or set attributes applied in an attributes file
>
> normal or set attributes applied on a node directly in a recipe
>
> override attributes applied in an attributes file
>
> override attributes applied in a role
>
> override attributes applied in an environment
>
> override attributes applied on a node directly in a recipe
>
>
>
> [1] http://wiki.opscode.com/display/chef/Setting+Attributes+%28Examples%29
Archive powered by MHonArc 2.6.16.