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:
parent
e59c8bd027
commit
4d52b0c4b3
|
@ -3,3 +3,5 @@
|
||||||
service:
|
service:
|
||||||
name: "wg-quick@{{ wireguard_interface }}"
|
name: "wg-quick@{{ wireguard_interface }}"
|
||||||
state: restarted
|
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)'"
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
tags:
|
tags:
|
||||||
- wg-config
|
- wg-config
|
||||||
notify:
|
notify:
|
||||||
- restart wireguard
|
- start/reload wireguard
|
||||||
|
|
||||||
- name: Check if reload-module-on-update is set
|
- name: Check if reload-module-on-update is set
|
||||||
stat:
|
stat:
|
||||||
|
|
Reference in New Issue