{ "name": "test", "default_attributes": { }, "override_attributes": { }, "json_class": "Chef::Role", "description": "This is just a test role, no big deal.", "chef_type": "role", "run_list": [ "recipe[test]" ] }
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.rbdefault['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
endNothing.....no errors ....no nothing. So..do overide attributes work? Is so..then why not working for me?
ThanksOverride 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.