Created
September 30, 2013 16:45
-
-
Save pcn/6766604 to your computer and use it in GitHub Desktop.
cookbook to set up knewton-specific conf files
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
| # Cookbook Name:: kcb_cassandra | |
| # Description:: Put platform-style config in the platform-style location | |
| # Recipe:: knewton_conf | |
| # Author:: Peter Norton | |
| # | |
| # | |
| # XXX requires configuration from the chef-server to be there for the environment | |
| %w{ aws environment }.each do |path| | |
| directory "#{node["knewton"]["conf_dir"]}/#{path}" do | |
| recursive true | |
| owner "root" | |
| group "root" | |
| mode "0755" | |
| end | |
| end | |
| billing_account = node["sedeploy"]["application"]["account"] | |
| bag_metadata = node["cassandra"]["priam"]["encrypted_databag"] | |
| account_iam_map = Chef::EncryptedDataBagItem.load( | |
| bag_metadata["bag_name"], bag_metadata["bag_item"], | |
| )[billing_account] | |
| iam_yaml = ::YAML::dump(account_iam_map[bag_metadata["iam_username"]]) | |
| ruby_block "print iam" do | |
| block do | |
| pp iam_yaml | |
| end | |
| end | |
| cookbook_file "#{node["knewton"]["conf_dir"]}/aws/stack_iam.yml" do | |
| content iam_yaml | |
| source "empty" | |
| owner "root" | |
| group "root" | |
| mode "0644" | |
| end | |
| cookbook_file "/etc/knewton/configuration/environment/platform.yml" do | |
| content ::YAML::dump(node["sedeploy"]["default_attributes"]["platform_environment"]) | |
| source "empty" | |
| owner "root" | |
| group "root" | |
| mode "0644" | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I started using remote_file, but it wants an actual URL in spite of the use case of overriding the content.