16 lines
564 B
Text
16 lines
564 B
Text
[Interface]
|
|
Address = {% for item in wireguard_peers %}{% if item['name'] == inventory_hostname %}{{ item['AllowedIPs'] }}
|
|
{% endif %}{% endfor %}
|
|
PrivateKey = {{ private_key }}
|
|
ListenPort = {{ listenport }}
|
|
|
|
{% for item in wireguard_peers %}{% if item['name'] != inventory_hostname and 'PublicKey' in item %}
|
|
|
|
# Peer name: {{ item.name }}
|
|
[Peer]
|
|
PublicKey = {{ item.PublicKey }}
|
|
AllowedIPs = {{ item.AllowedIPs }}
|
|
{% if item.EndPointIP is defined and item.EndPointIP != '' %}
|
|
EndPoint = {{ item.EndPointIP }}:{{ listenport }}
|
|
{% endif %}
|
|
{% endif %}{% endfor %}
|