-
-
Save tigris/e8d1f9769485d8685f9d to your computer and use it in GitHub Desktop.
Default precedence
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main/attributes/default.rb | |
default['foo'] = 'foo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main/attributes/other.rb | |
include_attribute 'main::default' | |
default['foo'] = 'bar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main/recipes/default.rb | |
Chef::Log.info "#### #{node['foo']}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# main/recipes/other.rb | |
Chef::Log.info "#### #{node['foo']}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "run_list": "recipe[main::other]" } |
Amazingly, it does not matter if run_list is set to main::other or main::default. You get the random foo/bar issue regardless, even though when running main::default, i would not expect it to ever even load the main/attributes/other.rb file!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For whatever reason, the results are random. Have fun 40 times, got 'foo' logged out 24 times and 'bar' logged out the other 16 times.