add restart handlers

This commit is contained in:
Mohammed Naser 2019-04-04 23:23:10 -04:00
parent f1b24d6ba4
commit a7f3e01a12
2 changed files with 12 additions and 0 deletions

9
handlers/main.yaml Normal file
View File

@ -0,0 +1,9 @@
---
- name: Restart tunnels
become: true
service:
name: "wg-quick@{{ item.name }}"
state: restarted
loop: "{{ wireguard_links }}"
loop_control:
label: "{{ item.name }}"

View File

@ -23,6 +23,9 @@
loop: "{{ wireguard_links }}" loop: "{{ wireguard_links }}"
loop_control: loop_control:
label: "{{ item.name }}" label: "{{ item.name }}"
notify: Restart tunnels
- meta: flush_handlers
- name: Enable and start services - name: Enable and start services
become: true become: true