aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-07 20:07:03 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-07 21:22:51 +0200
commit684699751fe5cf72020a59fd96326d588130cf35 (patch)
tree7c384e605b8bff58d510d5114fa2fdd557ed90f0
parentfactor out systemd service editing (diff)
downloadinfra-ansible-684699751fe5cf72020a59fd96326d588130cf35.tar.gz
infra-ansible-684699751fe5cf72020a59fd96326d588130cf35.zip
wireguard: refactoring, support peer endpoints
-rw-r--r--roles/wireguard/templates/wg0.conf8
1 files changed, 7 insertions, 1 deletions
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 %}