master
1include_recipe "stronglifters::user"
2include_recipe "stronglifters::aws"
3
4root_path = node["stronglifters"]["root_path"]
5shared_path = File.join(root_path, "shared")
6
7template "/etc/logrotate.d/rails" do
8 source "rails_logrotate.erb"
9 mode "0644"
10 variables({ shared_path: shared_path })
11end
12
13template "/etc/profile.d/rails.sh" do
14 variables(env: node["stronglifters"]["env"])
15end
16
17[root_path, shared_path, "#{shared_path}/config"].each do |dir|
18 directory dir do
19 mode "0755"
20 owner node["stronglifters"]["username"]
21 group node["stronglifters"]["username"]
22 recursive true
23 end
24end
25
26file "#{shared_path}/config/database.yml" do
27 content <<-YAML
28production:
29 adapter: postgresql
30 encoding: unicode
31 pool: 5
32 url: <%= ENV['DATABASE_URL'] %>
33YAML
34end