aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/wireguard/templates
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-04 14:02:00 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-04 14:02:00 +0200
commit495f6999e8a85fb59ecc19caacdb87d52e3eb228 (patch)
tree6e1a76dc959029219aa1220cef61a4347b1fd91b /roles/wireguard/templates
parentimport a couple more roles (diff)
downloadinfra-ansible-495f6999e8a85fb59ecc19caacdb87d52e3eb228.tar.gz
infra-ansible-495f6999e8a85fb59ecc19caacdb87d52e3eb228.zip
add wireguard role
Diffstat (limited to 'roles/wireguard/templates')
-rw-r--r--roles/wireguard/templates/wg0.conf15
1 files changed, 15 insertions, 0 deletions
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 %}