Feat: Add infiniband mac address support in nmcli module (#9962)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.15) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Waiting to run
import-galaxy / Test to import built collection artifact with Galaxy importer (push) Waiting to run
Verify REUSE / check (push) Waiting to run

* Feat: Add infiniband mac address support in nmcli module

* Add changelog fragment

* Tentative to fix the error

* Update changelogs/fragments/9962-nmcli-add-infiniband-mac-support.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/nmcli.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fix: fix test_bond_connection_unchanged module check

* Update plugins/modules/nmcli.py

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Update changelogs/fragments/9962-nmcli-add-infiniband-mac-support.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Benoît Leveugle 2025-04-14 22:36:40 +02:00 committed by GitHub
parent 0413774641
commit a7ab7e9247
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 2 deletions

View file

@ -99,6 +99,11 @@ options:
type: str
choices: [datagram, connected]
version_added: 5.8.0
infiniband_mac:
description:
- MAC address of the Infiniband IPoIB devices.
type: str
version_added: 10.6.0
slave_type:
description:
- Type of the device of this slave's master connection (for example V(bond)).
@ -1764,6 +1769,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 +2040,8 @@ class Nmcli(object):
options.update({
'infiniband.transport-mode': self.transport_mode,
})
if self.infiniband_mac:
options['infiniband.mac-address'] = self.infiniband_mac
elif self.type == 'vrf':
options.update({
'table': self.table,
@ -2708,9 +2716,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'],