2021-04-22 22:51:33 +02:00
|
|
|
{{ ansible_managed | comment }}
|
|
|
|
|
|
|
|
[Interface]
|
2021-07-08 00:33:13 +02:00
|
|
|
Address = {{ item.value.ip }}
|
2021-04-22 22:51:33 +02:00
|
|
|
PrivateKey = {{ item.value.private_key }}
|
|
|
|
ListenPort = {{ vpn_port }}
|
|
|
|
|
|
|
|
{% for peer in item.value.peers %}
|
|
|
|
[Peer]
|
2021-04-23 00:40:31 +02:00
|
|
|
{{ peer.comment | comment }}
|
2021-04-22 22:51:33 +02:00
|
|
|
Publickey = {{ peer.public_key }}
|
2022-07-21 18:51:45 +02:00
|
|
|
{% if peer.endpoint is defined %}
|
2021-07-12 02:09:39 +02:00
|
|
|
Endpoint = {{ peer.endpoint }}:{{ vpn_port }}
|
2021-04-22 22:51:33 +02:00
|
|
|
{% endif %}
|
2021-07-12 02:09:39 +02:00
|
|
|
AllowedIPs = {{ peer.allowed_ips | join(", ") }}
|
2021-04-22 22:51:33 +02:00
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
{% if item.value.keepalive %}
|
|
|
|
PersistentKeepalive = {{ vpn_keepalive_period }}
|
|
|
|
{% endif %}
|