2020-12-21 18:24:35 +00:00
|
|
|
- name: Install Wireguard
|
|
|
|
package:
|
2024-09-05 23:33:49 +01:00
|
|
|
name: wireguard
|
2020-12-21 18:24:35 +00:00
|
|
|
|
|
|
|
- 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:
|
2021-01-22 14:53:02 +00:00
|
|
|
name: wg-quick@wg0
|
2020-12-21 18:24:35 +00:00
|
|
|
enabled: true
|
|
|
|
|
|
|
|
- name: Enable p2p communication
|
|
|
|
sysctl:
|
|
|
|
name: net.ipv4.ip_forward
|
|
|
|
value: "1"
|
2022-01-11 20:51:12 +00:00
|
|
|
sysctl_set: true
|
2020-12-21 18:24:35 +00:00
|
|
|
state: present
|
2022-01-11 20:51:12 +00:00
|
|
|
reload: true
|
2020-12-21 18:24:35 +00:00
|
|
|
sysctl_file: /etc/sysctl.d/99-sysctl.conf
|