diff --git a/roles/wireguard-endpoint/templates/wireguard.conf.j2 b/roles/wireguard-endpoint/templates/wireguard.conf.j2 index 0ad2012..9f6779c 100644 --- a/roles/wireguard-endpoint/templates/wireguard.conf.j2 +++ b/roles/wireguard-endpoint/templates/wireguard.conf.j2 @@ -1,12 +1,15 @@ # {{ ansible_managed }} [Interface] -Address = {{ item.addrs | join(",") }} PrivateKey = {{ item.private_key }} ListenPort = {{ item.listen_port }} {% for peer in item.peers %} [Peer] PublicKey = {{ peer.public_key }} -AllowedIps = {{ peer.allowed_addrs | join(",") }} +AllowedIps = {{ peer.allowed_addrs | join(", ") }} +PersistentKeepalive = {{ peer.keepalive }} +{% if 'endpoint' in peer %} +Endpoint = {{ peer.endpoint }} +{% endif %} {% endfor %}