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