20 lines
474 B
YAML
20 lines
474 B
YAML
---
|
|
- name: Create WireGuard config directory
|
|
file:
|
|
path: "{{ wireguard_config_dir }}"
|
|
state: directory
|
|
mode: '0700'
|
|
|
|
- name: Generate WireGuard configuration
|
|
template:
|
|
src: wg-interface.conf.j2
|
|
dest: "{{ wireguard_config_dir }}/wg-{{ gateway_config.lab_name }}.conf"
|
|
mode: '0600'
|
|
notify: restart wireguard
|
|
|
|
- name: Enable WireGuard interface
|
|
systemd:
|
|
name: "wg-quick@wg-{{ gateway_config.lab_name }}"
|
|
enabled: yes
|
|
state: started
|