unbound: use handlers
Only restart unbound if the configuration was actually updated.
This commit is contained in:
parent
b94c62d710
commit
1dca5d2259
2 changed files with 7 additions and 5 deletions
4
roles/unbound/handlers/main.yml
Normal file
4
roles/unbound/handlers/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- name: restart unbound
|
||||||
|
systemd:
|
||||||
|
state: restarted
|
||||||
|
name: unbound
|
|
@ -24,20 +24,18 @@
|
||||||
src: unbound-control.conf.j2
|
src: unbound-control.conf.j2
|
||||||
dest: /etc/unbound/unbound.conf.d/unbound-control.conf
|
dest: /etc/unbound/unbound.conf.d/unbound-control.conf
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
notify: restart unbound
|
||||||
|
|
||||||
- name: setup main unbound config file
|
- name: setup main unbound config file
|
||||||
template:
|
template:
|
||||||
src: unbound.conf.j2
|
src: unbound.conf.j2
|
||||||
dest: /etc/unbound/unbound.conf
|
dest: /etc/unbound/unbound.conf
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
notify: restart unbound
|
||||||
|
|
||||||
- name: setup recursive DNS server config
|
- name: setup recursive DNS server config
|
||||||
template:
|
template:
|
||||||
src: recursive.conf.j2
|
src: recursive.conf.j2
|
||||||
dest: /etc/unbound/unbound.conf.d/recursive.conf
|
dest: /etc/unbound/unbound.conf.d/recursive.conf
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
notify: restart unbound
|
||||||
- name: restart unbound after editing config
|
|
||||||
systemd:
|
|
||||||
state: restarted
|
|
||||||
name: unbound
|
|
||||||
|
|
Loading…
Reference in a new issue