[chef] Attribute Precedence in recipe level


Chronological Thread 
  • From: millisami r < >
  • To: chef < >
  • Subject: [chef] Attribute Precedence in recipe level
  • Date: Mon, 20 May 2013 17:25:13 +0545



In my cookbook default attribute file:

    default['theoryofvalues-wp']['directory'] = "/var/www/theoryofvalues-wp"

And I'm trying to use the Wordpress cookbook (for e.g.) and I want to override the attribute
node.default['wordpress']['dir']


So in my recipe I set that attribute to:

    node.default['wordpress']['dir'] = node['theoryofvalues-wp']['directory']

But it does not affect.
I even tried with other versions

    include_recipe "wordpress::default"
    node.set['wordpress']['dir'] = node['theoryofvalues-wp']['directory']
    node.override['wordpress']['dir'] = node['theoryofvalues-wp']['directory']

Yeah, since I'm using chef 11 and the attributes precedence has changed, but am I doing it wrong?

Went through the following post and still not much clear on this
http://www.opscode.com/blog/2013/02/05/chef-11-in-depth-attributes-changes/

Any good example to follow with a one that is bad practices.

@millisami
~Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com



Archive powered by MHonArc 2.6.16.

§