3
0
Fork 0

add handler to reload existing wireguard interface

When new peers are added to the network, existing connections should not
be taken offline but interfaces should instead be edited in-flight.
This Commit adds and uses a handler that starts wireguard if not
running and afterwards reloads the peers from the configuration file
without taking down the wireguard interface.
This commit is contained in:
Christof Schulze 2020-01-05 16:02:27 +01:00
parent e59c8bd027
commit 4d52b0c4b3
2 changed files with 3 additions and 1 deletions

View File

@ -3,3 +3,5 @@
service:
name: "wg-quick@{{ wireguard_interface }}"
state: restarted
- name: start/reload wireguard
command: "bash -c 'systemctl start wg-quick@{{ wireguard_interface }}; wg syncconf {{ wireguard_interface}} <(wg-quick strip /etc/wireguard/{{ wireguard_interface }}.conf)'"

View File

@ -99,7 +99,7 @@
tags:
- wg-config
notify:
- restart wireguard
- start/reload wireguard
- name: Check if reload-module-on-update is set
stat: