From 4042d9595c97ceba4b9131758131b5c1888ab79e Mon Sep 17 00:00:00 2001 From: KemoNine Date: Mon, 10 Aug 2020 20:02:18 -0400 Subject: [PATCH] Add conditional for wg_additional_host_keys --- roles/wireguard/templates/wg.conf.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/wireguard/templates/wg.conf.j2 b/roles/wireguard/templates/wg.conf.j2 index 4addac6..74b4f61 100644 --- a/roles/wireguard/templates/wg.conf.j2 +++ b/roles/wireguard/templates/wg.conf.j2 @@ -69,6 +69,7 @@ Endpoint = {{host}}:{{wireguard_port}} {% endif %} {% endfor %} +{% if wg_additional_host_keys is defined %} {% for host in wg_additional_host_keys %} [Peer] # {{hostvars[host].name}} @@ -76,3 +77,4 @@ PublicKey = {{hostvars[host].public_key}} AllowedIPs = {{hostvars[host].wireguard_ip}}/32 PersistentKeepalive = {{hostvars[host].wireguard_persistent_keepalive}} {% endfor %} +{% endif %}