[chef] Attributes not getting set from wrapper cookbook


Chronological Thread 
  • From: millisami r < >
  • To: chef < >
  • Subject: [chef] Attributes not getting set from wrapper cookbook
  • Date: Wed, 11 Dec 2013 10:22:58 +0545


Ohai! Chefs!

Having issues with the attribute while developing wrapper cookbook to deploy the app cookbook.
Following are the 2 cookbooks to explain the problem.

=================================
app-cookbook
  - attributes
    default['asm']['user'] = "vagrant"
  - recipes
    - default.rb

    user node['asm']['user'] do
      password node['asm']['password']
      home "/home/#{node['asm']['user']}"
    end
---------------------------------
app-wrapper-cookbook
  - recipes
    - default.rb

    include_recipe "app-cookbook::default"
    node.set['asm']['user'] = 'otheruser'
=================================

When I run the `app-wrapper-cookbook`, the attribute set in wrapper cookbook `node.set['asm']['user'] = 'otheruser'` doesn't take effect. 
Instead it reads the value `vagrant`.
It should have been `otheruser` ?

How to solve this attribute precedence while building the wrapper cookbook ?


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



Archive powered by MHonArc 2.6.16.

§