Rails configuration yaml files served via chef
["s3", "urbanairship", "newrelic"].each do |yaml|
unless node[yaml.to_sym].empty?
template "#{node[:deploy][application][:deploy_to]}/shared/config/#{yaml}.yml" do
# create template under recipename/templates/default
# i.e. urbanairship.yml.erb
source "#{yaml}.yml.erb"
mode "0660"
owner deploy[:user]
group deploy[:group]
variables(:environment => deploy[:rails_env], :config => node[yaml.to_sym])
only_if do
File.exists?("#{node[:deploy][application][:deploy_to]}/shared/config")
end
end
end
end
Written by Marvin Marcelo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#