From: Tom Hughes Date: Thu, 27 Oct 2022 21:47:42 +0000 (+0100) Subject: Use a systemd timer for DNS updates X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/d64041e863fe325be5176e6b83098d2de3bc0051?ds=sidebyside;hp=46255a2ef0b3d14f8093beb7978de68a964b41d1 Use a systemd timer for DNS updates --- diff --git a/cookbooks/dns/metadata.rb b/cookbooks/dns/metadata.rb index fb1120681..521b38718 100644 --- a/cookbooks/dns/metadata.rb +++ b/cookbooks/dns/metadata.rb @@ -9,3 +9,4 @@ supports "ubuntu" depends "accounts" depends "apache" depends "git" +depends "systemd" diff --git a/cookbooks/dns/recipes/default.rb b/cookbooks/dns/recipes/default.rb index d7d038c30..11ae88e8a 100644 --- a/cookbooks/dns/recipes/default.rb +++ b/cookbooks/dns/recipes/default.rb @@ -169,9 +169,23 @@ template "/usr/local/bin/dns-check" do variables :passwords => passwords, :geoservers => geoservers end -cron_d "dns" do - minute "*/3" +systemd_service "dns-check" do + description "Rebuild DNS zones with GeoDNS changes" + exec_start "/usr/local/bin/dns-check" user "git" - command "/usr/local/bin/dns-check" - mailto "admins@openstreetmap.org" + private_tmp true + private_devices true + protect_system "strict" + protect_home true + read_write_paths "/var/lib/dns" +end + +systemd_timer "dns-check" do + description "Rebuild DNS zones with GeoDNS changes" + on_boot_sec "3m" + on_unit_active_sec "3m" +end + +service "dns-check.timer" do + action [:enable, :start] end