Skip to content

Commit

Permalink
[PR #7499/d0870a02 backport][stable-8] infiniband and bond interfaces…
Browse files Browse the repository at this point in the history
… can receive MTU settings too (#7527)

infiniband and bond interfaces can receive MTU settings too (#7499)

* infiniband and bond interfaces can receive MTU settings too

* adding test for default mtu setting

* the mtu parameter for infiniband is different than for ethernet

* adding changelog fragment

* Update changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit d0870a0)

Co-authored-by: mark-tomich <[email protected]>
  • Loading branch information
patchback[bot] and mark-tomich authored Nov 15, 2023
1 parent c1f9aea commit bf284a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- nmcli - allow for the setting of ``MTU`` for ``infiniband`` and ``bond`` interface types (https://github.com/ansible-collections/community.general/pull/7499).
7 changes: 6 additions & 1 deletion plugins/modules/nmcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1950,15 +1950,20 @@ def mac_setting(self):
@property
def mtu_conn_type(self):
return self.type in (
'bond',
'dummy',
'ethernet',
'infiniband',
'team-slave',
'vlan',
)

@property
def mtu_setting(self):
return '802-3-ethernet.mtu'
if self.type == 'infiniband':
return 'infiniband.mtu'
else:
return '802-3-ethernet.mtu'

@staticmethod
def mtu_to_string(mtu):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/plugins/modules/test_nmcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,8 @@
ipv6.method: auto
ipv6.ignore-auto-dns: no
ipv6.ignore-auto-routes: no
infiniband.transport-mode datagram
infiniband.mtu: auto
infiniband.transport-mode: datagram
"""

TESTCASE_INFINIBAND_STATIC_MODIFY_TRANSPORT_MODE = [
Expand Down

0 comments on commit bf284a0

Please sign in to comment.