From 6fc55cf5b659e006aac68101d1fc4f8f605054c7 Mon Sep 17 00:00:00 2001 From: Adrien Waksberg Date: Sun, 15 Oct 2017 00:52:30 +0200 Subject: [PATCH] fix: use reload for zone changed --- handlers/main.yml | 5 +++++ tasks/main.yml | 4 ++-- templates/dnssec.j2 | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 539b84a..6042ada 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -2,3 +2,8 @@ service: name: bind9 state: restarted + +- name: reload bind + service: + name: bind9 + state: reloaded diff --git a/tasks/main.yml b/tasks/main.yml index 27c5147..0d0f7cc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -61,14 +61,14 @@ mode: 0644 with_dict: '{{ bind_zones }}' register: zone - notify: restart bind + notify: reload bind tags: bind - name: dnssec sign shell: 'cd /etc/bind/keys && dnssec-signzone -3 $(head -n 1000 /dev/urandom | sha1sum | cut -b 1-16) -A -N INCREMENT -o {{ item.item.key }} -t /etc/bind/zones/db.{{ item.item.key }}' with_items: '{{ zone.results }}' when: item.changed and item.item.value.dnssec is defined and item.item.value.dnssec - notify: restart bind + notify: reload bind tags: bind - name: add cron dnssec diff --git a/templates/dnssec.j2 b/templates/dnssec.j2 index 9f12258..bbfd28d 100644 --- a/templates/dnssec.j2 +++ b/templates/dnssec.j2 @@ -9,4 +9,4 @@ dnssec-signzone -3 $(head -n 1000 /dev/urandom | sha1sum | cut -b 1-16) -A -N IN {% endif %} {% endfor %} -systemctl restart bind9 +systemctl reload bind9