From 32a6bb67778c6a313b1ded64ae5a6d3854d4fd07 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Fri, 4 Nov 2022 18:10:08 +0200 Subject: [PATCH] don't add peer for localhost --- templates/wireguard_client.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/wireguard_client.conf b/templates/wireguard_client.conf index 3df03c2..389d16a 100644 --- a/templates/wireguard_client.conf +++ b/templates/wireguard_client.conf @@ -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 %}