1
0
Fork 0
This repository has been archived on 2020-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
ansible-role-wireguard/handlers/main.yml
Robert Wimmer 8e7ed9e702
Use "wg syncconf" if available (#38)
* use wg syncconf if available

* use boolean as variable type for wg_syncconf

* update CHANGELOG

* update README
2020-01-26 23:30:16 +01:00

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"