infrastructure/ansible/roles/ingress/tasks/wireguard.yml
Jake Howard a2c6d7c276
Swap out alpine for debian on ingress
Mostly for future nebula deployment
2021-01-22 14:53:02 +00:00

34 lines
661 B
YAML

- name: Install Wireguard
package:
name:
- wireguard
become: true
- 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
become: true
notify: restart wireguard
- name: Enable wireguard
service:
name: wg-quick@wg0
enabled: true
become: true
- name: Enable p2p communication
sysctl:
name: net.ipv4.ip_forward
value: "1"
sysctl_set: yes
state: present
reload: yes
sysctl_file: /etc/sysctl.d/99-sysctl.conf
become: true