From 495f6999e8a85fb59ecc19caacdb87d52e3eb228 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 4 Aug 2023 14:02:00 +0200 Subject: add wireguard role --- roles/wireguard/templates/wg0.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 roles/wireguard/templates/wg0.conf (limited to 'roles/wireguard/templates') diff --git a/roles/wireguard/templates/wg0.conf b/roles/wireguard/templates/wg0.conf new file mode 100644 index 0000000..9e6f4c6 --- /dev/null +++ b/roles/wireguard/templates/wg0.conf @@ -0,0 +1,15 @@ +[Interface] +PrivateKey = {{ wg_private_key }} +Address = {{ wg_addr4 }}, {{ wg_addr6 }} +ListenPort = {{ wg_listen_port }} +{% if wg_peers is defined %} +{% for peer in wg_peers %} + +[Peer] +PublicKey = {{ peer.public_key }} +{% if peer.preshared_key is defined %} +PresharedKey = {{ peer.preshared_key }} +{% endif %} +AllowedIPs = {{ peer.addr4 }}/32, {{ peer.addr6 }}/128 +{% endfor %} +{% endif %} -- cgit v1.2.3