You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-role-wireguard/handlers/main.yml

18 lines
565 B
YAML

---
- name: restart wireguard
service:
name: "wg-quick@{{ wireguard_interface }}"
state: restarted
when: not wg_syncconf
listen: "reconfigure wireguard"
- name: syncconf wireguard
shell: |
systemctl is-active wg-quick@wg-quick@{{ wireguard_interface|quote }} || systemctl start wg-quick@{{ wireguard_interface|quote }}
wg syncconf {{ wireguard_interface|quote }} <(wg-quick strip /etc/wireguard/{{ wireguard_interface|quote }}.conf)
exit 0
args:
executable: "/bin/bash"
when: wg_syncconf
listen: "reconfigure wireguard"