I am dealing with a weird attributes issue. In my attributes/default.rb file, I have the following:
default[:test][:version] = ‘1.2.3’
I ran my recipe and used this attribute. Later I changed the value of attribute in default.rb file
to ‘2.3.4’. I expected my recipe to see the new value. However, its still seeing old value. Seems like the old value is being cached some where. I am not over writing this value any where else. Only referencing it. Even if I comment out that line in default.rb, my recipe still sees the old value.
I changed the line in attributes/default.rb as follows:
node.set[:test][:version] = value
Now my recipe sees what ever value is in the default.rb file. If I change default.rb to the way it was earlier i.e. changed the ‘node.set’ to ‘default’. It still retains the old value set using node.set.
I enabled attributes debugging by adding the following code to my recipe:
pp node.debug_value(:test, :version)
I see the following:
Compiling Cookbooks... [["set_unless_enabled?", false], ["default", "6.5.1"], ["env_default", :not_present], ["role_default", :not_present], ["force_default", :not_present], ["normal", "6.4.1"], <--- this is the old value that my recipe sees ["override", :not_present], ["role_override", :not_present], ["env_override", :not_present], ["force_override", :not_present], ["automatic", :not_present]]
How do I ensure, that my recipe always gets the value in my attributes file and not some cached value? Thanks.