ansible-private-box/roles/wireguard/tasks/main.yml

24 lines
472 B
YAML
Raw Normal View History

2021-11-10 20:47:51 +03:00
---
- name: install wg packages
apt:
name: ['wireguard','wireguard-tools']
state: present
- name: install wg hub config
template:
src: templates/wghub.conf.j2
dest: /etc/wireguard/wghub.conf
- name: enable and persist ip forwarding
sysctl:
name: net.ipv4.ip_forward
value: "1"
state: present
sysctl_set: yes
reload: yes
- name: start and enable wireguard
systemd:
name: wg-quick@wghub
enabled: yes
state: started