From a97d13387329ec2e22a69a21680b25a2f47078d6 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 5 Mar 2024 12:46:26 +0100 Subject: [PATCH] =?UTF-8?q?fabric:=20don=E2=80=99t=20set=20bond=20slaves?= =?UTF-8?q?=20if=20there=20are=20none?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not that that should happen except by mistake. --- roles/fabric/templates/switch.intf.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/fabric/templates/switch.intf.j2 b/roles/fabric/templates/switch.intf.j2 index 9a20fb3..66b8528 100644 --- a/roles/fabric/templates/switch.intf.j2 +++ b/roles/fabric/templates/switch.intf.j2 @@ -12,7 +12,9 @@ iface {{ iface.name }} {% if iface.type.value == 'lag' %} {#- Bond/MLAG stuff. #} {% set members = interfaces | selectattr('lag') | selectattr('lag.name', '==', iface.name) %} +{% if members %} bond-slaves {{ members | map(attribute='name') | join(' ') }} +{% endif %} {% if iface.custom_fields.bond_mode %} bond-mode {{ iface.custom_fields.bond_mode }} {% endif %}