diff --git a/roles/unbound/handlers/main.yml b/roles/unbound/handlers/main.yml new file mode 100644 index 0000000..c2efa8f --- /dev/null +++ b/roles/unbound/handlers/main.yml @@ -0,0 +1,4 @@ +- name: restart unbound + systemd: + state: restarted + name: unbound diff --git a/roles/unbound/tasks/main.yml b/roles/unbound/tasks/main.yml index 7374281..cabae99 100644 --- a/roles/unbound/tasks/main.yml +++ b/roles/unbound/tasks/main.yml @@ -24,20 +24,18 @@ src: unbound-control.conf.j2 dest: /etc/unbound/unbound.conf.d/unbound-control.conf mode: 0644 + notify: restart unbound - name: setup main unbound config file template: src: unbound.conf.j2 dest: /etc/unbound/unbound.conf mode: 0644 + notify: restart unbound - name: setup recursive DNS server config template: src: recursive.conf.j2 dest: /etc/unbound/unbound.conf.d/recursive.conf mode: 0644 - -- name: restart unbound after editing config - systemd: - state: restarted - name: unbound + notify: restart unbound