From c8534ef734d2fbe4b100aaf6ffd942e403c296a3 Mon Sep 17 00:00:00 2001 From: Mark Tomich Date: Tue, 7 Nov 2023 18:07:07 -0500 Subject: [PATCH 1/5] infiniband and bond interfaces can receive MTU settings too --- plugins/modules/nmcli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/modules/nmcli.py b/plugins/modules/nmcli.py index 3882f851793..003a8ceb617 100644 --- a/plugins/modules/nmcli.py +++ b/plugins/modules/nmcli.py @@ -1950,8 +1950,10 @@ def mac_setting(self): @property def mtu_conn_type(self): return self.type in ( + 'bond', 'dummy', 'ethernet', + 'infiniband', 'team-slave', 'vlan', ) From b70d6c87158481465cd3efce4009dabeb1d39a9e Mon Sep 17 00:00:00 2001 From: Mark Tomich Date: Wed, 8 Nov 2023 10:45:46 -0500 Subject: [PATCH 2/5] adding test for default mtu setting --- tests/unit/plugins/modules/test_nmcli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/plugins/modules/test_nmcli.py b/tests/unit/plugins/modules/test_nmcli.py index 893caa0db6a..3508f4d2045 100644 --- a/tests/unit/plugins/modules/test_nmcli.py +++ b/tests/unit/plugins/modules/test_nmcli.py @@ -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 = [ From 7bc14c11659073b7c4b93dc810ba322ecce8bc4a Mon Sep 17 00:00:00 2001 From: Mark Tomich Date: Wed, 8 Nov 2023 15:11:34 -0500 Subject: [PATCH 3/5] the mtu parameter for infiniband is different than for ethernet --- plugins/modules/nmcli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/modules/nmcli.py b/plugins/modules/nmcli.py index 003a8ceb617..d12a309bc66 100644 --- a/plugins/modules/nmcli.py +++ b/plugins/modules/nmcli.py @@ -1960,7 +1960,10 @@ def mtu_conn_type(self): @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): From b5898830f8c102f9f803dcd80d55ac62d7f26ea2 Mon Sep 17 00:00:00 2001 From: Mark Tomich Date: Wed, 8 Nov 2023 15:21:34 -0500 Subject: [PATCH 4/5] adding changelog fragment --- ...7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml diff --git a/changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml b/changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml new file mode 100644 index 00000000000..281bb8aa589 --- /dev/null +++ b/changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml @@ -0,0 +1,2 @@ +minor_changes: + - nmcli - allow for the setting of ``MTU`` for ``infiniband`` and ``bond`` interface types From f066b34fb188e912a53aa88076c9d272d82ac246 Mon Sep 17 00:00:00 2001 From: mark-tomich Date: Wed, 8 Nov 2023 17:59:15 -0500 Subject: [PATCH 5/5] Update changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml Co-authored-by: Felix Fontein --- ...7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml b/changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml index 281bb8aa589..f12aa557608 100644 --- a/changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml +++ b/changelogs/fragments/7499-allow-mtu-setting-on-bond-and-infiniband-interfaces.yml @@ -1,2 +1,2 @@ minor_changes: - - nmcli - allow for the setting of ``MTU`` for ``infiniband`` and ``bond`` interface types + - nmcli - allow for the setting of ``MTU`` for ``infiniband`` and ``bond`` interface types (https://github.com/ansible-collections/community.general/pull/7499).