ansible-role-wireguard_client/templates/wireguard_client.conf

17 lines
564 B
Text
Raw Normal View History

2022-10-11 09:19:16 +02:00
[Interface]
2022-11-04 17:08:06 +01:00
Address = {% for item in wireguard_peers %}{% if item['name'] == inventory_hostname %}{{ item['AllowedIPs'] }}
2022-11-04 17:04:15 +01:00
{% endif %}{% endfor %}
2022-11-04 16:55:00 +01:00
PrivateKey = {{ private_key }}
2022-10-11 09:19:16 +02:00
ListenPort = {{ listenport }}
2022-11-04 17:11:03 +01:00
{% for item in wireguard_peers %}{% if item['name'] != inventory_hostname and 'PublicKey' in item %}
2022-11-04 16:55:00 +01:00
# Peer name: {{ item.name }}
2022-10-11 09:19:16 +02:00
[Peer]
2022-11-04 16:55:00 +01:00
PublicKey = {{ item.PublicKey }}
AllowedIPs = {{ item.AllowedIPs }}
{% if item.EndPointIP is defined and item.EndPointIP != '' %}
EndPoint = {{ item.EndPointIP }}:{{ listenport }}
2022-11-04 16:55:57 +01:00
{% endif %}
2022-11-04 17:10:08 +01:00
{% endif %}{% endfor %}