Update some vars

This commit is contained in:
Alex 2020-05-21 20:21:01 +02:00
parent 47ae9f14eb
commit 6f146f527c
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
2 changed files with 10 additions and 5 deletions

View File

@ -1,3 +1,8 @@
- name: Include sensitive info
include_vars:
dir: '/vault/main.yml'
tags:
- vault
- name: Copy configuration files - name: Copy configuration files
loop: loop:
- { src: "wireguard.conf.j2", dest: "/etc/wireguard/wg0.conf", mode: '600' } - { src: "wireguard.conf.j2", dest: "/etc/wireguard/wg0.conf", mode: '600' }

View File

@ -1,12 +1,12 @@
[Interface] [Interface]
Address = {{ services.wireguard.net.v4.addr }}.1/{{ services.wireguard.net.v4.range.serv }}, {{ services.wireguard.net.v6.addr }}:1/{{ services.wireguard.net.v6.range.serv }} Address = {{ wireguard.net.v4.addr }}.1/{{ wireguard.net.v4.range.serv }}, {{ wireguard.net.v6.addr }}:1/{{ wireguard.net.v6.range.serv }}
PostUp = iptables -A FORWARD -i {{ services.wireguard.interface }} -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i {{ services.wireguard.interface }} -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE PostUp = iptables -A FORWARD -i {{ wireguard.interface }} -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i {{ wireguard.interface }} -j ACCEPT; ip6tables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i {{ services.wireguard.interface }} -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i {{ services.wireguard.interface }} -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE PostDown = iptables -D FORWARD -i {{ wireguard.interface }} -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i {{ wireguard.interface }} -j ACCEPT; ip6tables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = {{ services.wireguard.port }} ListenPort = {{ wireguard.port }}
PrivateKey = {{ wg.privkey }} PrivateKey = {{ wg.privkey }}
{% for user in services.wireguard.peers %} {% for user in services.wireguard.peers %}
[Peer] [Peer]
PublicKey = {{ user.pubkey }} PublicKey = {{ user.pubkey }}
AllowedIPs = {{ services.wireguard.net.v4.addr }}.{{ user.bit }}/{{ services.wireguard.net.v4.range.clnt }}, {{ services.wireguard.net.v6.addr}}:{{ user.bit }}/{{ services.wireguard.net.v6.range.clnt }} AllowedIPs = {{ wireguard.net.v4.addr }}.{{ user.bit }}/{{ wireguard.net.v4.range.clnt }}, {{ wireguard.net.v6.addr}}:{{ user.bit }}/{{ wireguard.net.v6.range.clnt }}
{% endfor %} {% endfor %}