Details
-
Type:
Bug
-
Status:
Fix Committed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 0.10.2, 0.10.4
-
Fix Version/s: 10.26.0, 11.6.0-client
-
Component/s: Chef Shell
-
Labels:
Description
An override attribute or the role is not being set when using shef 0.10.2. It is set correctly in the webui, or when using shef 0.9.18.
This is put into the attributes file:
default.order.number = 0
They then Assigned both of these roles to the same system:
order1.rb:
name "order1"
description "order1"
override_attributes "order" => {
"number" => 1 }
order2.rb:
name "order2"
description "order2"
override_attributes "order" => {
"number" => 2 }
When they run this command though, they would expect node.order.number to equal 2:
chef > node.run_list_collect{|rl| rl.name}
=> ["hax", "risk", "order1", "order2"]
chef > node.order.number
=> 0
Related ticket: http://help.opscode.com/discussions/problems/707-upgrade-to-chef-0102-causes-weird-attribute-behavior-in-shef
Issue Links
- is cloned by
-
CHEF-3274
shef doesn't process attribute precedence properly
-
The problem seems to be not just with override attributes but any attribute set from a role. For instance
vagrant@ubuntu-11:~$ sudo shef -z -c /etc/chef/client.rb loading configuration: /etc/chef/client.rb Session type: client Loading...[Fri, 12 Aug 2011 18:48:07 +0000] INFO: Run List is [recipe[variable-test], role[attr-tester]] [Fri, 12 Aug 2011 18:48:07 +0000] INFO: Run List expands to [variable-test] ..[Fri, 12 Aug 2011 18:48:08 +0000] INFO: Loading cookbooks [variable-test] done. This is shef, the Chef shell. Chef Version: 0.10.4 http://www.opscode.com/chef http://wiki.opscode.com/display/chef/Home run `help' for help, `exit' or ^D to quit. Ohai2u vagrant@ubuntu-11.04! chef > node["test_attr2"] => "hobit" chef > nodes.show("ubuntu-11.04-sdanna")['test_attr1'] => "frob" chef > node['test_attr1'] => nilSee also, http://help.opscode.com/discussions/problems/759-inconsistent-attributes-between-chef-client-and-shef