[chef] Re: chef-solo and override attributes will not work in json role


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: chef-solo and override attributes will not work in json role
  • Date: Thu, 16 Jan 2014 09:18:16 -0800


On Thursday, January 16, 2014 at 12:28 AM, David Montgomery wrote:

Do override attributes work in chef-solo?

Here is my role:


{
    "name": "server",
    "chef_type": "role",
    "description": "server",
    "override_attributes": {"environment":{"git_repos":["logic"]}},
    "run_list": ["recipe[build-essential]","recipe[java]","recipe[environment::scm]" ]
}


In my cookbook called "environment"...in attributes have this this:

#cookbooks/'environment/attributes/default.rb
default['environment']['git_repos'] = []


In my scm recipe "recipe[environment::scm]" I have this for a test:

git_repos = node['environment']['git_repos']
git_repos.each do |repo|

  directory "/home/ubuntu/wtf/" do
    owner "root"
    group "root"
    #mode "0775"
    recursive true
    action :create
  end

end


Nothing.....no errors ....no nothing.  So..do overide attributes work?  Is so..then why not working for me?

Thanks



Override attributes are only set by cookbooks, roles, or environments. Attributes from the json file are always “normal” level, which is similar to how they work in chef-client.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§