infrastructure/ansible/roles/ingress/tasks/wireguard.yml
Jake Howard d5a7a61171
All checks were successful
/ terraform (push) Successful in 38s
/ ansible (push) Successful in 1m30s
Remove unnecessary use of become from some roles
This should make execution much faster
2024-09-09 17:09:03 +01:00

29 lines
595 B
YAML

- name: Install Wireguard
package:
name: wireguard
- name: Get wireguard credentials
set_fact:
ingress_wireguard: "{{ wireguard.clients.ingress }}"
- name: Wireguard config
template:
src: files/wireguard.conf
dest: /etc/wireguard/wg0.conf
mode: "0600"
backup: true
notify: restart wireguard
- name: Enable wireguard
service:
name: wg-quick@wg0
enabled: true
- name: Enable p2p communication
sysctl:
name: net.ipv4.ip_forward
value: "1"
sysctl_set: true
state: present
reload: true
sysctl_file: /etc/sysctl.d/99-sysctl.conf