fix(wireguard): reload tunnel via syncconf on config change

Config template changes were never applied to the running interface,
leaving a stale peer list after redeploy. Notify a syncconf reload so
peer edits apply without dropping active connections.
This commit is contained in:
Clément Désiles
2026-08-27 10:14:23 +02:00
parent 842374616b
commit 8a3c323059
2 changed files with 10 additions and 0 deletions
+9
View File
@@ -6,3 +6,12 @@
- name: Apply sysctl - name: Apply sysctl
ansible.builtin.command: sysctl --system ansible.builtin.command: sysctl --system
changed_when: true changed_when: true
- name: Reload wireguard tunnel
ansible.builtin.shell: |
set -o pipefail
wg-quick strip "{{ item.interface }}" | wg syncconf "{{ item.interface }}"
args:
executable: /bin/bash
loop: "{{ wireguard_tunnels }}"
changed_when: true
+1
View File
@@ -43,6 +43,7 @@
owner: root owner: root
group: root group: root
mode: "0600" mode: "0600"
notify: Reload wireguard tunnel
- name: "Create systemd override directory for wg-quick@{{ _tunnel.interface }}" - name: "Create systemd override directory for wg-quick@{{ _tunnel.interface }}"
ansible.builtin.file: ansible.builtin.file: