add restart of vpn when changes

This commit is contained in:
Antonio J. Delgado 2023-07-12 08:56:01 +03:00
parent 13607e8b84
commit f6c48db73f

View file

@ -39,6 +39,8 @@
port: "{{ vpnes_port }}" port: "{{ vpnes_port }}"
comment: 'Wireguard client listener' comment: 'Wireguard client listener'
proto: udp proto: udp
notify:
- Restart Wireguard service
- name: Show public key reminder - name: Show public key reminder
debug: debug:
@ -90,6 +92,8 @@
rule: allow rule: allow
from: "{{ pub_ip.json.ip }}" from: "{{ pub_ip.json.ip }}"
delegate_to: "{{ groups['wireguard_server'][0] }}" delegate_to: "{{ groups['wireguard_server'][0] }}"
notify:
- Restart Wireguard service
- name: Ping VPN server for monitoring - name: Ping VPN server for monitoring
shell: "ping -c 3 -4 {{ server_address }}" shell: "ping -c 3 -4 {{ server_address }}"