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.
2018-08-12 20:21:45 +00:00
|
|
|
---
|
|
|
|
- name: restart wireguard
|
|
|
|
service:
|
2019-01-07 21:56:20 +00:00
|
|
|
name: "wg-quick@{{ wireguard_interface }}"
|
2020-04-03 18:59:32 +00:00
|
|
|
state: "{{ item }}"
|
|
|
|
loop:
|
|
|
|
- stopped
|
|
|
|
- started
|
2020-01-26 22:30:16 +00:00
|
|
|
when: not wg_syncconf
|
|
|
|
listen: "reconfigure wireguard"
|
|
|
|
|
|
|
|
- name: syncconf wireguard
|
|
|
|
shell: |
|
2020-02-04 21:17:00 +00:00
|
|
|
set -o errexit
|
|
|
|
set -o pipefail
|
|
|
|
set -o nounset
|
2020-01-26 22:30:16 +00:00
|
|
|
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"
|