]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/oxidized/recipes/default.rb
oxidized: use runtime directory for systemd
[chef.git] / cookbooks / oxidized / recipes / default.rb
index 5754ceefe9aef7cd7c68ed16ee9645529f3b500d..6d5486d498980bd90da1fcd1c2fa987101882870 100644 (file)
@@ -78,6 +78,12 @@ git "/opt/oxidized/daemon" do
   notifies :run, "bundle_install[/opt/oxidized/daemon]"
 end
 
+directory "/opt/oxidized/.ssh" do
+  owner "oxidized"
+  group "oxidized"
+  mode "700"
+end
+
 # Key is set as a deployment key in github repo
 file "/opt/oxidized/.ssh/id_rsa" do
   content keys["git"].join("\n")
@@ -101,6 +107,18 @@ execute "/opt/oxidized/.ssh/id_rsa.pub" do
   notifies :restart, "service[oxidized]"
 end
 
+ssh_known_hosts_entry 'github.com' do
+  file_location "/opt/oxidized/.ssh/known_hosts"
+  owner "oxidized"
+  group "oxidized"
+end
+
+directory "/var/lib/oxidized" do
+  owner "oxidized"
+  group "oxidized"
+  mode "750"
+end
+
 git "/var/lib/oxidized/configs.git" do
   action :sync
   repository "git@github.com:openstreetmap/oxidized-configs.git" # Uses oxidized ssh key
@@ -123,6 +141,7 @@ systemd_service "oxidized" do
   after "network.target"
   user "oxidized"
   working_directory "/opt/oxidized/daemon"
+  runtime_directory "oxidized"
   exec_start "#{node[:ruby][:bundle]} exec oxidized"
   environment "OXIDIZED_HOME" => "/etc/oxidized",
               "OXIDIZED_LOGS" => "/var/log/oxidized"