don't add peer for localhost

This commit is contained in:
Antonio J. Delgado 2022-11-04 18:10:08 +02:00
parent e1c652eb5c
commit 32a6bb6777

View file

@ -4,7 +4,7 @@ Address = {% for item in wireguard_peers %}{% if item['name'] == inventory_hostn
PrivateKey = {{ private_key }}
ListenPort = {{ listenport }}
{% for item in wireguard_peers %}
{% for item in wireguard_peers %}{% if item['name'] != inventory_hostname %}
# Peer name: {{ item.name }}
[Peer]
@ -13,4 +13,4 @@ AllowedIPs = {{ item.AllowedIPs }}
{% if item.EndPointIP is defined and item.EndPointIP != '' %}
EndPoint = {{ item.EndPointIP }}:{{ listenport }}
{% endif %}
{% endfor %}
{% endif %}{% endfor %}