21 lines
583 B
YAML
21 lines
583 B
YAML
---
|
|
- name: restart wireguard
|
|
ansible.builtin.shell: |
|
|
wg syncconf {{ wireguard_interface }} <(wg-quick strip {{ wireguard_interface }})
|
|
args:
|
|
executable: /bin/bash
|
|
ignore_errors: true
|
|
register: wg_sync_result
|
|
|
|
- name: restart wireguard (fallback)
|
|
ansible.builtin.systemd:
|
|
name: "wg-quick@{{ wireguard_interface }}"
|
|
state: restarted
|
|
enabled: true
|
|
when: wg_sync_result is failed
|
|
|
|
- name: reload wireguard
|
|
ansible.builtin.shell: |
|
|
wg syncconf {{ wireguard_interface }} <(wg-quick strip {{ wireguard_interface }})
|
|
args:
|
|
executable: /bin/bash
|