Created
October 17, 2011 20:29
-
-
Save jtimberman/1293701 to your computer and use it in GitHub Desktop.
goes in chef-repo/data_bags/apache/
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
{ | |
"id": "stuff", | |
"admin_address": { | |
"_default": "noone@example.com", | |
"production": "root@example.com", | |
"development": "devs@example.com", | |
} | |
} |
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
<VirtualHost *:80> | |
# bunch of config! | |
ServerAdmin <%= @server_admin %> | |
# Other config! | |
</VirtualHost> |
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
# selecting the address from the data bag by environment | |
apache_stuff = data_bag_item("apache", "stuff") | |
template "/etc/apache2/sites-available/my_vhost.conf" do | |
source "my_vhost.conf.erb" | |
variables(:server_admin => apache_stuff['admin_address'][node.chef_environment]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment