Last active
August 29, 2015 14:05
-
-
Save tfitch/e431ebf5ada7da119767 to your computer and use it in GitHub Desktop.
Name/value pairs from cookbook attributes to dynamic resource attributes
This file contains hidden or 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 for the iis_pool | |
default['config']['setting']['runtime_version'] = '12' | |
default['config']['setting']['thirty_two_bit'] = false | |
default['config']['setting']['max_proc'] = 4 |
This file contains hidden or 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
# same result as hardcoded-recipe.rb but now driven by Attributes | |
iis_pool 'MyAppPool' do | |
node['config']['setting'].each do |setting, value| | |
send(setting, value) | |
end | |
action :config | |
end |
This file contains hidden or 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
# outputs the same as hardcoded-recipe.rb but does *not* work | |
iis_pool 'MyAppPool' do | |
node['config']['setting'].each do |setting, value| | |
"#{setting}" "#{value}" | |
end | |
action :config | |
end |
This file contains hidden or 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
# if nothing was dynamic | |
iis_pool 'MyAppPool' do | |
runtime_version '12' | |
max_proc 4 | |
thirty_two_bit false | |
action :config | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment