Last active
August 29, 2015 14:19
-
-
Save amaltson/f92596148d1406d194ad to your computer and use it in GitHub Desktop.
Attribute 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
... | |
suites: | |
- name: default | |
run_list: | |
... | |
attributes: | |
otpp_redis: | |
primary: | |
search_criteria: 'run_list:recipe[otpp_redis::primary]' |
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
# attributes/default.rb | |
... | |
puts "Primary attribute computed: #{node['otpp_redis']['primary']}" | |
default['otpp_redis']['primary']['address'] = 'Chef search will override' | |
default['otpp_redis']['primary']['port'] = '6379' | |
default['otpp_redis']['primary']['search_criteria'] = 'To be overriden in wrapper cookbooks' | |
puts "Primary attribute default: #{node.default['otpp_redis']['primary']}" | |
puts "Primary attribute normal: #{node.normal['otpp_redis']['primary']}" | |
puts "Primary attribute computed: #{node['otpp_redis']['primary']}" | |
... |
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
Primary attribute computed: {"search_criteria"=>"run_list:recipe[otpp_redis::primary]"} | |
Primary attribute default: {"address"=>"Chef search will override", "port"=>"6379", "search_criteria"=>"To be overriden in wrapper cookbooks"} | |
Primary attribute normal: {"search_criteria"=>"run_list:recipe[otpp_redis::primary]"} | |
Primary attribute computed: {"search_criteria"=>"run_list:recipe[otpp_redis::primary]"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment