From 67aaee3b4e6ba8f433a57dfa4462f074d0fa8ca9 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 24 Jan 2025 07:58:31 -0500 Subject: [PATCH] Adapt to the bond modes When the team modes were defined in attributes, it was based on the teamd names. Since the ecosystem abandoned teamd, we went back to bond. However, we neglected to map all the names to the closest bond type equivalent. Change confignet to do the mapping. --- confluent_osdeploy/common/profile/scripts/confignet | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index 71c156a7..f9818c62 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -301,6 +301,12 @@ class WickedManager(object): class NetworkManager(object): + bondtypes = { + 'lacp': '802.3ad', + 'loadbalance': 'balance-alb', + 'roundrobin': 'balance-rr', + 'activebackup:' 'active-backup', + } def __init__(self, devtypes, deploycfg): self.deploycfg = deploycfg self.connections = {} @@ -401,8 +407,8 @@ class NetworkManager(object): for arg in cmdargs: cargs.append(arg) cargs.append(cmdargs[arg]) - if stgs['team_mode'] == 'lacp': - stgs['team_mode'] = '802.3ad' + if stgs['team_mode'] in self.bondtypes: + stgs['team_mode'] = self.bondtypes[stgs['team_mode']] subprocess.check_call(['nmcli', 'c', 'add', 'type', 'bond', 'con-name', cname, 'connection.interface-name', cname, 'bond.options', 'mode={}'.format(stgs['team_mode'])] + cargs) for iface in cfg['interfaces']: self.add_team_member(cname, iface)