The recent changes to the config template, namely adding a condition linking ListenPort to wireguard_endpoint have broken the ability to set a port on the interface without an endpoint defined. On 17.1.0 we get a random port assigned by WG every time, because the portion of the template setting up ListenPort never gets rendered. Server interfaces don't need endpoints configured - only the client peers need to specify endpoints to know where to connect, so this condition doesn't match WireGuard's actual requirements.
Change was merged in with 17.1.0 - #101 /
https://github.com/githubixx/ansible-role-wireguard/pull/102/files
https://github.com/githubixx/ansible-role-wireguard/blob/master/templates/etc/wireguard/wg.conf.j2#L18-L20:
[Interface]
...
{% if wireguard_endpoint is defined and wireguard_endpoint != "" %}
ListenPort = {{ wireguard_port }}
{% endif %}
Note that this is on the interface, not the peer. This functionality works as expected on 17.0.0 prior to the changes above.
The recent changes to the config template, namely adding a condition linking
ListenPorttowireguard_endpointhave broken the ability to set a port on the interface without an endpoint defined. On17.1.0we get a random port assigned by WG every time, because the portion of the template setting upListenPortnever gets rendered. Server interfaces don't need endpoints configured - only the client peers need to specify endpoints to know where to connect, so this condition doesn't match WireGuard's actual requirements.Change was merged in with
17.1.0- #101 /https://github.com/githubixx/ansible-role-wireguard/pull/102/files
https://github.com/githubixx/ansible-role-wireguard/blob/master/templates/etc/wireguard/wg.conf.j2#L18-L20:
Note that this is on the interface, not the peer. This functionality works as expected on
17.0.0prior to the changes above.