This commit is contained in:
Benoît Leveugle 2025-04-04 07:42:01 +00:00 committed by GitHub
commit 07bfa63e1b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions
changelogs/fragments
plugins/modules

View file

@ -0,0 +1,2 @@
minor_changes:
- nmcli - Add support for infiniband mac setting when type is infiniband (https://github.com/ansible-collections/community.general/pull/9962).

View file

@ -99,6 +99,10 @@ options:
type: str
choices: [datagram, connected]
version_added: 5.8.0
infiniband_mac:
description:
- MAC address of the Infiniband IPoIB devices.
type: str
slave_type:
description:
- Type of the device of this slave's master connection (for example V(bond)).
@ -1764,6 +1768,7 @@ class Nmcli(object):
self.wireguard = module.params['wireguard']
self.vpn = module.params['vpn']
self.transport_mode = module.params['transport_mode']
self.infiniband_mac = module.params['infiniband_mac']
self.sriov = module.params['sriov']
if self.method4:
@ -2034,6 +2039,10 @@ class Nmcli(object):
options.update({
'infiniband.transport-mode': self.transport_mode,
})
if self.infiniband_mac:
options.update({
'infiniband.mac-address': self.infiniband_mac,
})
elif self.type == 'vrf':
options.update({
'table': self.table,
@ -2708,9 +2717,12 @@ def main():
tap=dict(type='bool'))),
wireguard=dict(type='dict'),
vpn=dict(type='dict'),
transport_mode=dict(type='str', choices=['datagram', 'connected']),
sriov=dict(type='dict'),
table=dict(type='int'),
# infiniband specific vars
transport_mode=dict(type='str', choices=['datagram', 'connected']),
infiniband_mac=dict(type='str'),
),
mutually_exclusive=[['never_default4', 'gw4'],
['routes4_extended', 'routes4'],