Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nmcli: add transport_mode configuration for Infiniband devices #5361

Merged
merged 9 commits into from
Oct 23, 2022
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- "nmcli - Add transport_mode configuration for Infiniband devices (https://github.com/ansible-collections/community.general/pull/5361)."
ThomasGebert marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 13 additions & 0 deletions plugins/modules/net_tools/nmcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@
type: str
choices: [ 802.3ad, active-backup, balance-alb, balance-rr, balance-tlb, balance-xor, broadcast ]
default: balance-rr
transport_mode:
description:
- This option sets the connection type of Infiniband IPoIB devices.
type: str
choices: [ datagram, connected ]
default: datagram
ThomasGebert marked this conversation as resolved.
Show resolved Hide resolved
ThomasGebert marked this conversation as resolved.
Show resolved Hide resolved
master:
description:
- Master <master (ifname, or connection UUID or conn_name) of bridge, team, bond master connection profile.
Expand Down Expand Up @@ -1481,6 +1487,7 @@ def __init__(self, module):
self.gsm = module.params['gsm']
self.wireguard = module.params['wireguard']
self.vpn = module.params['vpn']
self.transport_mode = module.params['transport_mode']

if self.method4:
self.ipv4_method = self.method4
Expand Down Expand Up @@ -1693,6 +1700,11 @@ def connection_options(self, detect_change=False):
options.update({
'vpn.data': vpn_data_values,
})
elif self.type == 'infiniband':
options.update({
'infiniband.transport-mode': self.transport_mode,
})

# Convert settings values based on the situation.
for setting, value in options.items():
setting_type = self.settings_type(setting)
Expand Down Expand Up @@ -2285,6 +2297,7 @@ def main():
gsm=dict(type='dict'),
wireguard=dict(type='dict'),
vpn=dict(type='dict'),
transport_mode=dict(type='str', default='datagram', choices=['datagram', 'connected']),
),
mutually_exclusive=[['never_default4', 'gw4'],
['routes4_extended', 'routes4'],
Expand Down