Created
June 18, 2015 22:13
-
-
Save ranjib/2f7e1482a3ac8f6e5bfc to your computer and use it in GitHub Desktop.
Consuming common datra across environments using Chef's ruby environment DSL
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
# located at chef_repo/environments/org1-prod.rb | |
require 'deep_merge' | |
name 'org1-prod' | |
description 'Production environment for org1' | |
org1_yml_path = File.expand_path('../common/org1.yml', __FILE__) | |
common = YAML.load_file(org1_yml_path) | |
default_attributes( | |
common['default'].deep_merge!( | |
# declare all you org1-prod specific things here. | |
'x' => 1, | |
'y' => 2 | |
) | |
) |
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
# located at chef_repo/emvironments/common/org1.yml | |
-- | |
default: | |
org1: | |
bar: baz | |
strange: [1, 2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment