infra/roles/pdns/templates/wireguard.conf

15 lines
463 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 = {{ 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 %}