ansible/roles/wireguard-endpoint/templates/wireguard.conf.j2

15 lines
358 B
Django/Jinja

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