feat(edge_vps): add WireGuard setup task and template
This commit is contained in:
19
roles/edge_vps/tasks/20_wireguard.yaml
Normal file
19
roles/edge_vps/tasks/20_wireguard.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
- name: Install WireGuard
|
||||
ansible.builtin.apt:
|
||||
name: wireguard
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Deploy WireGuard config
|
||||
ansible.builtin.template:
|
||||
src: wireguard/wg0.conf.j2
|
||||
dest: "{{ edge_vps_wireguard_config_dir }}/{{ edge_vps_wireguard_interface }}.conf"
|
||||
mode: "0600"
|
||||
notify: restart wireguard
|
||||
|
||||
- name: Enable WireGuard
|
||||
ansible.builtin.systemd:
|
||||
name: "wg-quick@{{ edge_vps_wireguard_interface }}"
|
||||
enabled: true
|
||||
state: started
|
||||
Reference in New Issue
Block a user