1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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 <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
mark-tomich 2023-11-15 16:01:35 -05:00 committed by GitHub
parent df66885fa4
commit d0870a022e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -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).

View file

@ -1950,15 +1950,20 @@ class Nmcli(object):
@property @property
def mtu_conn_type(self): def mtu_conn_type(self):
return self.type in ( return self.type in (
'bond',
'dummy', 'dummy',
'ethernet', 'ethernet',
'infiniband',
'team-slave', 'team-slave',
'vlan', 'vlan',
) )
@property @property
def mtu_setting(self): def mtu_setting(self):
return '802-3-ethernet.mtu' if self.type == 'infiniband':
return 'infiniband.mtu'
else:
return '802-3-ethernet.mtu'
@staticmethod @staticmethod
def mtu_to_string(mtu): def mtu_to_string(mtu):

View file

@ -1445,7 +1445,8 @@ ipv4.may-fail: yes
ipv6.method: auto ipv6.method: auto
ipv6.ignore-auto-dns: no ipv6.ignore-auto-dns: no
ipv6.ignore-auto-routes: no ipv6.ignore-auto-routes: no
infiniband.transport-mode datagram infiniband.mtu: auto
infiniband.transport-mode: datagram
""" """
TESTCASE_INFINIBAND_STATIC_MODIFY_TRANSPORT_MODE = [ TESTCASE_INFINIBAND_STATIC_MODIFY_TRANSPORT_MODE = [