mirror of
https://github.com/fscotto/infra.git
synced 2026-09-27 19:03:47 +00:00
26 lines
724 B
Django/Jinja
26 lines
724 B
Django/Jinja
# Managed by Ansible. Do not edit manually.
|
|
[Interface]
|
|
Address = {{ wireguard_address }}
|
|
PrivateKey = {{ wireguard_private_key_material.content | b64decode | trim }}
|
|
MTU = {{ wireguard_mtu }}
|
|
SaveConfig = false
|
|
{% if wireguard_listen_port | int > 0 %}
|
|
ListenPort = {{ wireguard_listen_port }}
|
|
{% endif %}
|
|
|
|
{% for peer in wireguard_peers %}
|
|
[Peer]
|
|
# {{ peer.name }}
|
|
PublicKey = {{ hostvars[peer.host].wireguard_public_key }}
|
|
AllowedIPs = {{ peer.allowed_ips | join(', ') }}
|
|
{% if peer.endpoint is defined %}
|
|
Endpoint = {{ peer.endpoint }}
|
|
{% endif %}
|
|
{% if peer.persistent_keepalive | default(0) | int > 0 %}
|
|
PersistentKeepalive = {{ peer.persistent_keepalive }}
|
|
{% endif %}
|
|
{% if not loop.last %}
|
|
|
|
{% endif %}
|
|
{% endfor %}
|