From dbc00fd448020048cb01b1618831e10eb9738b47 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 27 Feb 2024 13:16:51 +0100 Subject: [PATCH] fabric: add custom field on dcim.Interface for bond mode --- roles/fabric/templates/switch.intf.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/roles/fabric/templates/switch.intf.j2 b/roles/fabric/templates/switch.intf.j2 index 29185b1..9a20fb3 100644 --- a/roles/fabric/templates/switch.intf.j2 +++ b/roles/fabric/templates/switch.intf.j2 @@ -13,6 +13,9 @@ iface {{ iface.name }} {#- Bond/MLAG stuff. #} {% set members = interfaces | selectattr('lag') | selectattr('lag.name', '==', iface.name) %} bond-slaves {{ members | map(attribute='name') | join(' ') }} +{% if iface.custom_fields.bond_mode %} + bond-mode {{ iface.custom_fields.bond_mode }} +{% 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 is defined %} {% set peer_members = hostvars[peer].interfaces | selectattr('lag') | selectattr('lag.name', '==', iface.name) %}