diff --git a/files/unbound.conf b/files/unbound.conf index 3371de1..add780a 100644 --- a/files/unbound.conf +++ b/files/unbound.conf @@ -4,7 +4,6 @@ remote-control: control-enable: no server: - # listen on local network, allow local network access {% for address in unbound_listen_addresses %} interface: {{ address }} {% endfor %} @@ -13,7 +12,6 @@ server: chroot: "" - # logging log-time-ascii: yes log-queries: no verbosity: 1 diff --git a/handlers/main.yml b/handlers/main.yml index 91239c1..204352d 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,4 +1,10 @@ --- +- name: unbound checkconf + command: unbound-checkconf /etc/unbound/unbound.conf + changed_when: True + notify: restart unbound + + - name: restart unbound service: name: unbound diff --git a/tasks/main.yml b/tasks/main.yml index 2e6211d..90c2fe0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -17,6 +17,8 @@ mode: 'u=rw,g=r,o=r' with_fileglob: - 'files/snippets/*.conf' + notify: + - unbound checkconf - name: Copy main unbound configuration @@ -26,6 +28,5 @@ owner: root group: root mode: 'u=rw,g=r,o=r' - validate: 'unbound-checkconf %s' notify: - - restart unbound + - unbound checkconf