infra/roles/pdns/templates/wireguard.conf
2024-01-17 16:46:07 -08:00

14 lines
463 B
Text

[Interface]
PrivateKey = {{ lookup('ansible.builtin.ini', 'private_key section=wireguard file=secrets/' + inventory_hostname + '.ini') }}
ListenPort = 51822
Address = {{ wireguard_ip }}
{% for host in hostvars %}
{% if host != inventory_hostname %}
# {{ host }}
[Peer]
Endpoint = {{ hostvars[host].wireguard_endpoint|default(host) }}:51822
PublicKey = {{ hostvars[host].wireguard_pubkey }}
AllowedIPs = {{ hostvars[host].wireguard_ip }}
{% endif %}{% endfor %}