X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/cf3730fdb4d1f5d5e5738cf7e5b27ccade78e488..c3be356ba81afff0a666355e018531de69e0a5fb:/cookbooks/planet/recipes/replication.rb diff --git a/cookbooks/planet/recipes/replication.rb b/cookbooks/planet/recipes/replication.rb index ddf278a2d..5c07ae231 100644 --- a/cookbooks/planet/recipes/replication.rb +++ b/cookbooks/planet/recipes/replication.rb @@ -74,13 +74,6 @@ remote_directory "/usr/local/bin" do files_mode "755" end -template "/usr/local/bin/replicate-minute" do - source "replicate-minute.erb" - owner "root" - group "root" - mode "755" -end - template "/usr/local/bin/users-agreed" do source "users-agreed.erb" owner "root" @@ -239,10 +232,6 @@ systemd_timer "replication-minutely" do accuracy_sec 5 end -file "/etc/replication/auth.conf" do - action :delete -end - ## Hourly replication directory "/store/planet/replication/hour" do @@ -329,6 +318,27 @@ systemd_timer "replication-daily" do on_calendar "*-*-* *:02/15:00" end +## Replication cleanup + +systemd_service "replication-cleanup" do + description "Cleanup replication" + user "planet" + exec_start "/usr/local/bin/replicate-cleanup" + private_tmp true + private_devices true + private_network true + protect_system "full" + protect_home true + no_new_privileges true +end + +systemd_timer "replication-cleanup" do + description "Cleanup replication" + on_boot_sec 60 + on_unit_active_sec 86400 + accuracy_sec 1800 +end + ## Enable/disable feeds if node[:planet][:replication] == "enabled" @@ -365,6 +375,10 @@ if node[:planet][:replication] == "enabled" service "replication-daily.timer" do action [:enable, :start] end + + service "replication-cleanup.timer" do + action [:enable, :start] + end else cron_d "users-agreed" do action :delete @@ -389,4 +403,8 @@ else service "replication-daily.timer" do action [:stop, :disable] end + + service "replication-cleanup.timer" do + action [:stop, :disable] + end end