Init
This commit is contained in:
23
roles/wireguard/tasks/main.yml
Normal file
23
roles/wireguard/tasks/main.yml
Normal 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
|
||||
4
roles/wireguard/templates/wghub.conf.j2
Normal file
4
roles/wireguard/templates/wghub.conf.j2
Normal file
@@ -0,0 +1,4 @@
|
||||
[Interface]
|
||||
Address = 10.205.101.1/24
|
||||
ListenPort = {{ wg_port }}
|
||||
PrivateKey = {{ wg_privkey }}
|
||||
Reference in New Issue
Block a user