diff --git a/roles/base/handlers/main.yml b/roles/base/handlers/main.yml index 9d9c0c9..2abd1aa 100644 --- a/roles/base/handlers/main.yml +++ b/roles/base/handlers/main.yml @@ -4,3 +4,9 @@ connect_timeout: 5 listen: reboot_host when: allow_reboot + +- name: Restart WireGuard + service: + name: wg-quick@wg0 + state: restarted + listen: restart_wireguard diff --git a/roles/base/tasks/wireguard.yml b/roles/base/tasks/wireguard.yml index 81f17b2..7c6bd3c 100644 --- a/roles/base/tasks/wireguard.yml +++ b/roles/base/tasks/wireguard.yml @@ -41,6 +41,8 @@ template: src: wireguard.j2 dest: /etc/wireguard/wg0.conf + notify: + - restart_wireguard - name: Start WireGuard interface service: