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

18 lines
565 B
YAML
Raw Normal View History

---
- name: restart wireguard
service:
2019-01-07 21:56:20 +00:00
name: "wg-quick@{{ wireguard_interface }}"
state: restarted
when: not wg_syncconf
2020-01-25 20:49:48 +00:00
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
2020-01-25 20:49:48 +00:00
listen: "reconfigure wireguard"