ansible/roles/wireguard_endpoint/templates/wireguard.conf.j2

15 lines
392 B
Django/Jinja

{{ ansible_managed | comment }}
[Interface]
PrivateKey = {{ item.private_key }}
{% if 'listen_port' in item %}
ListenPort = {{ item.listen_port }}
{% endif %}
[Peer]
PublicKey = {{ item.peer.public_key }}
AllowedIps = {{ item.peer.allowed_addrs | join(", ") }}
PersistentKeepalive = {{ item.peer.keepalive }}
{% if 'endpoint' in item.peer %}
Endpoint = {{ item.peer.endpoint }}
{% endif %}