From 610a0ba43fd00e8ed5bbc32958fde340bfdaab65 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 13 Jun 2019 17:42:41 +0100 Subject: [PATCH] Reload gdnsd configuration when new maps are distributed --- cookbooks/geodns/metadata.rb | 1 + cookbooks/geodns/recipes/default.rb | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/cookbooks/geodns/metadata.rb b/cookbooks/geodns/metadata.rb index bbc676a39..15699486e 100644 --- a/cookbooks/geodns/metadata.rb +++ b/cookbooks/geodns/metadata.rb @@ -6,3 +6,4 @@ description "Installs and configures a geographic DNS server" long_description IO.read(File.join(File.dirname(__FILE__), "README.md")) version "1.0.0" supports "ubuntu" +depends "systemd" diff --git a/cookbooks/geodns/recipes/default.rb b/cookbooks/geodns/recipes/default.rb index 9f7c100c5..16ba44ed5 100644 --- a/cookbooks/geodns/recipes/default.rb +++ b/cookbooks/geodns/recipes/default.rb @@ -56,6 +56,29 @@ service "gdnsd" do supports :status => true, :restart => true, :reload => true end +systemd_service "gdnsd-reload" do + description "Reload gdnsd configuration" + type "simple" + user "root" + exec_start "/bin/systemctl reload-or-restart gdnsd" + standard_output "null" + private_tmp true + private_devices true + protect_system "full" + protect_home true + no_new_privileges true +end + +systemd_path "gdnsd-reload" do + description "Reload gdnsd configuration" + path_changed "/etc/gdnsd/config.d" +end + +service "gdnsd-reload.path" do + action [:enable, :start] + subscribes :restart, "systemd_path[gdnsd-reload]" +end + firewall_rule "accept-dns-udp" do action :accept source "net" -- 2.43.2