infra/roles/pdns/templates/wireguard.conf

15 lines
464 B
Text
Raw Normal View History

2024-01-17 17:45:49 +00:00
[Interface]
PrivateKey = {{ lookup('ansible.builtin.ini', 'private_key section=wireguard file=secrets/' + inventory_hostname + '.ini') }}
ListenPort = 51822
Address = {{ dns_wg_ip }}
2024-01-17 17:45:49 +00:00
{% for host in groups['nameservers'] %}
2024-01-17 17:45:49 +00:00
{% if host != inventory_hostname %}
# {{ host }}
[Peer]
Endpoint = {{ hostvars[host].dns_wg_endpoint|default(host) }}:51822
PublicKey = {{ hostvars[host].dns_wg_pubkey }}
AllowedIPs = {{ hostvars[host].dns_wg_ip }}
2024-01-17 17:45:49 +00:00
{% endif %}{% endfor %}