add reload and startup management to interface
This commit is contained in:
parent
8e3a6b943e
commit
412c3b2eec
2 changed files with 16 additions and 0 deletions
14
handlers/main.yml
Normal file
14
handlers/main.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
- name: start wireguard interface
|
||||
command:
|
||||
argv:
|
||||
- ifup
|
||||
- 'wg_{{ item.name }}'
|
||||
|
||||
- name: reload wireguard interface
|
||||
command:
|
||||
argv:
|
||||
- wg
|
||||
- syncconf
|
||||
- 'wg_{{ item.name }}'
|
||||
- '/etc/wireguard/wg_{{ item.name }}.conf'
|
||||
|
|
@ -5,8 +5,10 @@
|
|||
template:
|
||||
src: networkinterface.j2
|
||||
dest: /etc/network/interfaces.d/wg_{{ item.name }}
|
||||
notify: start wireguard interface
|
||||
|
||||
- name: "generate wireguard config ({{ item.name }})"
|
||||
template:
|
||||
src: wireguard.conf.j2
|
||||
dest: /etc/wireguard/wg_{{ item.name }}.conf
|
||||
notify: reload wireguard interface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue