Check if wireguard_endpoint exists before checking if it is empty (#92)

master
Jamison Lofthouse 4 years ago committed by GitHub
parent 663d3b9a5f
commit a41231675f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,10 +71,12 @@ Endpoint = {{hostvars[host].wireguard_endpoint}}:{{hostvars[host].wireguard_port
{% else %} {% else %}
Endpoint = {{host}}:{{hostvars[host].wireguard_port}} Endpoint = {{host}}:{{hostvars[host].wireguard_port}}
{% endif %} {% endif %}
{% elif hostvars[host].wireguard_endpoint is defined and hostvars[host].wireguard_endpoint != "" %} {% elif hostvars[host].wireguard_endpoint is defined %}
{% if hostvars[host].wireguard_endpoint != "" %}
Endpoint = {{hostvars[host].wireguard_endpoint}}:{{wireguard_port}} Endpoint = {{hostvars[host].wireguard_endpoint}}:{{wireguard_port}}
{% elif hostvars[host].wireguard_endpoint == "" %} {% else %}
# No endpoint defined for this peer # No endpoint defined for this peer
{% endif %}
{% else %} {% else %}
Endpoint = {{host}}:{{wireguard_port}} Endpoint = {{host}}:{{wireguard_port}}
{% endif %} {% endif %}

Loading…
Cancel
Save