Skip to content

Commit

Permalink
Merge branch 'fix-unset-wireguard-endpoint-custom-port' of daanh432/a…
Browse files Browse the repository at this point in the history
…nsible-role-wireguard into master

Pull request githubixx#177
Closes githubixx#176
  Fixed unsetting the Wireguard endpoint whilst using a custom port
  • Loading branch information
gregorydlogan committed Feb 20, 2024
2 parents b2d2a88 + e445a60 commit 0955476
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 @@ -88,8 +88,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 0955476

Please sign in to comment.