diff --git a/templates/etc/wireguard/wg.conf.j2 b/templates/etc/wireguard/wg.conf.j2 index 1feb09c..d8c0ebe 100644 --- a/templates/etc/wireguard/wg.conf.j2 +++ b/templates/etc/wireguard/wg.conf.j2 @@ -65,7 +65,7 @@ PersistentKeepalive = {{hostvars[host].wireguard_persistent_keepalive}} ) %} Endpoint = {{hostvars[host].wireguard_dc['endpoint']}}:{{hostvars[host].wireguard_dc['port']}} -{% elif hostvars[host].wireguard_port is defined and hostvars[host].wireguard_port is number %} +{% elif hostvars[host].wireguard_port is defined %} {% if hostvars[host].wireguard_endpoint is defined and hostvars[host].wireguard_endpoint != "" %} Endpoint = {{hostvars[host].wireguard_endpoint}}:{{hostvars[host].wireguard_port}} {% else %}