ansible
This commit is contained in:
parent
7974e36c1b
commit
b81f7e15b2
41 changed files with 1632 additions and 0 deletions
21
ansible/roles/wireguard/handlers/main.yaml
Normal file
21
ansible/roles/wireguard/handlers/main.yaml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue