From bf4bc2e55371f6e0d5aae5fed2f5814955dd644c Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 9 Oct 2023 12:05:54 +0200 Subject: wireguard: skip self --- ansible/roles/wireguard/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ansible/roles') diff --git a/ansible/roles/wireguard/tasks/main.yml b/ansible/roles/wireguard/tasks/main.yml index 193b549..67529bd 100644 --- a/ansible/roles/wireguard/tasks/main.yml +++ b/ansible/roles/wireguard/tasks/main.yml @@ -71,7 +71,7 @@ {% for hostname in wg_net.hosts|sort %} {% set host = wg_net.hosts[hostname] %} {% set present = not (host.state is defined) or host.state == 'present' %} - {% if present and (all_peers or host.endpoint is defined) %} + {% if present and (all_peers or host.endpoint is defined) and (hostname != inventory_hostname) %} # {{ hostname }} [WireGuardPeer] -- cgit v1.2.3