Commit dd02000

mo khan <mo@mokhan.ca>
2015-12-23 22:24:04
make env variable available via profile.d/
1 parent 13f62f3
Changed files (3)
recipes/rails.rb
@@ -10,7 +10,7 @@ template "/etc/logrotate.d/rails" do
   variables({ shared_path: shared_path })
 end
 
-template "/home/#{node["stronglifters"]["username"]}/.profile" do
+template "/etc/profile.d/rails.sh" do
   variables(env: node["stronglifters"]["env"])
 end
 
templates/.profile.erb
@@ -1,3 +0,0 @@
-<% @env.each do |key, value| %>
-<%= key.to_s.upcase %>="<%= value.to_s.gsub("\n", '\n') %>"
-<% end %>
templates/rails.sh.erb
@@ -0,0 +1,3 @@
+<% @env.each do |key, value| %>
+export <%= key.to_s.upcase %>="<%= value.to_s.gsub("\n", '\n') %>"
+<% end %>