initial commit, here be dragons

This commit is contained in:
2021-04-04 18:45:11 +02:00
commit 58137668b7
39 changed files with 1237 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
- name: Start a-vpn
ansible.builtin.systemd:
name: wg-quick@a-vpn
state: restarted
enabled: yes

View File

@@ -0,0 +1,31 @@
---
- name: Activate IP4 forwarding in kernel
ansible.posix.sysctl:
name: net.ipv4.ip_forward
value: '1'
sysctl_file: /etc/sysctl.d/99-ip-forwarding.conf
state: present
reload: yes
- name: Activate IP6 forwarding in kernel
ansible.posix.sysctl:
name: net.ipv6.conf.all.forwarding
value: '1'
sysctl_file: /etc/sysctl.d/99-ip-forwarding.conf
state: present
reload: yes
- name: Provision wireguard tools
ansible.builtin.apt: { name: "wireguard-tools" }
- name: Template a-vpn configuration
ansible.builtin.template:
src: a-vpn.conf.j2
dest: /etc/wireguard/a-vpn.conf
mode: 0600
owner: root
group: root
notify: [ "Start a-vpn" ]
- name: Flush handlers
ansible.builtin.meta: flush_handlers

View File

@@ -0,0 +1,10 @@
[Interface]
PrivateKey = {{ vault.wireguard.host.private_key }}
Address = 10.0.22.1
ListenPort = 51841
[Peer]
# User1 - Machine1
PublicKey = {{ vault.wireguard.user1.machine1.public_key }}
AllowedIPs = 10.0.22.11/32
PresharedKey = {{ vault.wireguard.user1.machine1.preshared_key }}