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 %}