This commit is contained in:
2021-11-10 17:47:51 +00:00
commit 452f4bef14
10 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
---
- 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

View File

@@ -0,0 +1,4 @@
[Interface]
Address = 10.205.101.1/24
ListenPort = {{ wg_port }}
PrivateKey = {{ wg_privkey }}