mail-server/ansible/templates/wireguard.conf.j2
2024-05-29 22:06:22 +03:00

14 lines
326 B
Django/Jinja

{% set _wg = lookup('vars', inventory_hostname + '_wg') %}
# {{ ansible_managed }}
[Interface]
PrivateKey = {{ _wg.private_key }}
ListenPort = {{ _wg.port }}
{% for peer in _wg.peers %}
[Peer]
# {{ peer.name }}
PublicKey = {{ peer.public_key }}
Endpoint = {{ peer.endpoint }}
AllowedIPs = {{ peer.allowed_ips }}
{% endfor %}