diff --git a/templates/wg.conf.j2 b/templates/wg.conf.j2 index 56b9bec..4f0a12c 100644 --- a/templates/wg.conf.j2 +++ b/templates/wg.conf.j2 @@ -68,7 +68,7 @@ SaveConfig = true {% endif %} {% endif %} {% endfor %} -{# unmanaged hosts #} +{% if wireguard_unmanaged_hosts is defined %} {% for hostdata in uh_public_key.results %} [Peer] @@ -76,3 +76,4 @@ SaveConfig = true PublicKey = {{ hostdata.stdout }} AllowedIPs = {{ hostdata.item.allowed_ips}} {% endfor %} +{% endif %}