Check if wireguard_endpoint exists before checking if it is empty (#92)
This commit is contained in:
parent
663d3b9a5f
commit
a41231675f
1 changed files with 4 additions and 2 deletions
|
@ -71,10 +71,12 @@ Endpoint = {{hostvars[host].wireguard_endpoint}}:{{hostvars[host].wireguard_port
|
|||
{% else %}
|
||||
Endpoint = {{host}}:{{hostvars[host].wireguard_port}}
|
||||
{% 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}}
|
||||
{% elif hostvars[host].wireguard_endpoint == "" %}
|
||||
{% else %}
|
||||
# No endpoint defined for this peer
|
||||
{% endif %}
|
||||
{% else %}
|
||||
Endpoint = {{host}}:{{wireguard_port}}
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue