From 5381fecaa4bc81a0158e8e756e7992e699ced8cd Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 26 Feb 2024 10:06:26 +0100 Subject: [PATCH] fabric: fix check for peer switch --- roles/fabric/templates/bond.intf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/fabric/templates/bond.intf.j2 b/roles/fabric/templates/bond.intf.j2 index 0c87d0b..46a9bb0 100644 --- a/roles/fabric/templates/bond.intf.j2 +++ b/roles/fabric/templates/bond.intf.j2 @@ -12,7 +12,7 @@ iface {{ bond.name }} {% endif %} {#- If the peer shares a bond with the same name, generate a clag-id for it unless the bonded link is to peer itself. #} -{% if peer %} +{% if peer is defined %} {% set peer_members = hostvars[peer].interfaces | selectattr('lag') | selectattr('lag.name', '==', bond.name) %} {% if peer_members | iface_peer | reject('eq', inventory_hostname) %}