]> git.openstreetmap.org Git - chef.git/commitdiff
Use a systemd timer for DNS updates
authorTom Hughes <tom@compton.nu>
Thu, 27 Oct 2022 21:47:42 +0000 (22:47 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 27 Oct 2022 21:47:42 +0000 (22:47 +0100)
cookbooks/dns/metadata.rb
cookbooks/dns/recipes/default.rb

index fb112068119ccb5be9e87dd923fc7e5f45cf04f8..521b387183ea9150792bdb9d9475edc9653abbe9 100644 (file)
@@ -9,3 +9,4 @@ supports          "ubuntu"
 depends           "accounts"
 depends           "apache"
 depends           "git"
+depends           "systemd"
index d7d038c30c4ca18cbf9e477e8d6eb53263b00ceb..11ae88e8ac0a4246c06a7d9c146cd7dacb7b8982 100644 (file)
@@ -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