Skip to content

Commit

Permalink
Fixed issue with forcing an peer to have an unset wireguard_endpoint …
Browse files Browse the repository at this point in the history
…whilst using a custom port

Related to issue githubixx#176
  • Loading branch information
daanh432 authored Jan 29, 2023
1 parent f6a6e46 commit e445a60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion templates/etc/wireguard/wg.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ PersistentKeepalive = {{hostvars[host].wireguard_persistent_keepalive}}
%}
Endpoint = {{hostvars[host].wireguard_dc['endpoint']}}:{{hostvars[host].wireguard_dc['port']}}
{% elif hostvars[host].wireguard_port is defined %}
{% if hostvars[host].wireguard_endpoint is defined and hostvars[host].wireguard_endpoint != "" %}
{% if hostvars[host].wireguard_endpoint is defined %}
{% if hostvars[host].wireguard_endpoint != "" %}
Endpoint = {{hostvars[host].wireguard_endpoint}}:{{hostvars[host].wireguard_port}}
{% else %}
# No endpoint defined for this peer
{% endif %}
{% else %}
Endpoint = {{host}}:{{hostvars[host].wireguard_port}}
{% endif %}
Expand Down

0 comments on commit e445a60

Please sign in to comment.