Closed jbwyatt4 closed 8 years ago
The chef solo json files don't take default/overrides like this since they're always the final override on top of everything else.
See https://docs.chef.io/chef_solo.html for details. Specifically the "Attributes" section and the warning section where --json-attributes
is covered.
Hope that helps!
I'm afraid I don't understand it that well. How would I override a normal attribute using the node or role file with chef-solo?
Node is different than role. Node would be {"attribute_name": "attribute_value"}
at the top level of the JSON hash. For a role I'd recommend using a .rb role and a default_attributes
call like the one shown in https://docs.chef.io/roles.html (e.g., default_attributes attribute_name: "attribute_value"
)
Thankyou! Got it working.
:+1:
Hello,
I've attached a role to demonstrate (.txt was added because github didn't like a json file). I test for the attributes in the recipe with:
p node.override p node.attribute?("r_version")
I keep getting false or nil every time.
ubuntu-rails-app-server.json.txt
Using knife-solo 0.5.1