From 684699751fe5cf72020a59fd96326d588130cf35 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 7 Aug 2023 20:07:03 +0200 Subject: wireguard: refactoring, support peer endpoints --- roles/wireguard/templates/wg0.conf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/wireguard/templates/wg0.conf b/roles/wireguard/templates/wg0.conf index 9e6f4c6..c6d94a1 100644 --- a/roles/wireguard/templates/wg0.conf +++ b/roles/wireguard/templates/wg0.conf @@ -10,6 +10,12 @@ PublicKey = {{ peer.public_key }} {% if peer.preshared_key is defined %} PresharedKey = {{ peer.preshared_key }} {% endif %} -AllowedIPs = {{ peer.addr4 }}/32, {{ peer.addr6 }}/128 +AllowedIPs = {{ peer.allowed_ips }} +{% if peer.endpoint is defined %} +Endpoint = {{ peer.endpoint }} +{% endif %} +{% if peer.persistent_keepalive is defined %} +PersistentKeepalive = 25 +{% endif %} {% endfor %} {% endif %} -- cgit v1.2.3