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
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue