ansible/roles/ifupdown2/templates/wireguard.conf.j2

17 lines
511 B
Text
Raw Permalink Normal View History

{{ ansible_managed | comment }}
[Interface]
PrivateKey = {{ item.value.private_key }}
{% if "listen_port" in item.value %}
ListenPort = {{ item.value.listen_port }}
{% endif %}
[Peer]
PublicKey = {{ item.value.peer_public_key }}
AllowedIPs = {{ item.value.peer_allowed_addresses | join(", ") }}
PersistentKeepalive = {{ item.value.peer_keepalive
| default(ifupdown2__wireguard_keepalive) }}
{% if "peer_endpoint" in item.value %}
Endpoint = {{ item.value.peer_endpoint }}
{% endif %}