ansible.fftdf.supernode/roles/21-install-wireguard/handlers/main.yml

20 lines
509 B
YAML
Raw Normal View History

2022-05-09 10:16:09 +00:00
---
- name: restart wireguard
ansible.builtin.service:
name: "wg-quick@vpn01"
state: "{{ item }}"
loop:
- stopped
- started
listen: "reconfigure wireguard"
- name: syncconf wireguard
ansible.builtin.shell: |
set -o errexit
set -o pipefail
set -o nounset
systemctl is-active wg-quick@vpn01 || systemctl start wg-quick@vpn01
wg syncconf vpn01 <(wg-quick strip /etc/wireguard/vpn01.conf)
exit 0
args:
executable: "/bin/bash"
listen: "reconfigure wireguard"