From fcb79dd933a643f9f45520f3f338d654e272c932 Mon Sep 17 00:00:00 2001 From: mkilar Date: Wed, 13 Aug 2025 16:12:43 +0200 Subject: [PATCH 1/2] add support for disable_lacp_suspend_individual for non-vpc port-channels --- docs/cisco.dcnm.dcnm_interface_module.rst | 21 +++++++++++++++++++++ plugins/modules/dcnm_interface.py | 16 ++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/docs/cisco.dcnm.dcnm_interface_module.rst b/docs/cisco.dcnm.dcnm_interface_module.rst index 0eecb3898..f79197acb 100644 --- a/docs/cisco.dcnm.dcnm_interface_module.rst +++ b/docs/cisco.dcnm.dcnm_interface_module.rst @@ -1146,6 +1146,27 @@ Parameters
Description of the interface
+ + + + +
+ disable_lacp_suspend_individual + +
+ boolean +
+ + + + + +
If disabled, lacp will put the port to individual state and not suspend the port in case the port does not get LACP BPDU from the peer ports in the port-channel
+ + diff --git a/plugins/modules/dcnm_interface.py b/plugins/modules/dcnm_interface.py index fbb800c63..25fdf2bbe 100644 --- a/plugins/modules/dcnm_interface.py +++ b/plugins/modules/dcnm_interface.py @@ -196,6 +196,12 @@ - State of Switchport Monitor for SPAN/ERSPAN type: bool default: false + disable_lacp_suspend_individual: + description: + - If disabled, lacp will put the port to individual state and not suspend the port + in case the port does not get LACP BPDU from the peer ports in the port-channel + type: bool + default: false profile_vpc: description: - Though the key shown here is 'profile_vpc' the actual key to be used in playbook @@ -2320,6 +2326,7 @@ def dcnm_intf_validate_port_channel_input(self, config): enable_pfc=dict(type="bool", default=False), duplex=dict( type="str", default="auto", choices=["auto", "full", "half"]), + disable_lacp_suspend_individual=dict(type="bool", default=False), ) pc_prof_spec_access = dict( @@ -2340,6 +2347,7 @@ def dcnm_intf_validate_port_channel_input(self, config): enable_pfc=dict(type="bool", default=False), duplex=dict( type="str", default="auto", choices=["auto", "full", "half"]), + disable_lacp_suspend_individual=dict(type="bool", default=False), ) pc_prof_spec_l3 = dict( @@ -2912,6 +2920,10 @@ def dcnm_intf_get_pc_payload(self, delem, intf, profile): "ENABLE_MONITOR"] = delem[profile]["enable_monitor"] intf["interfaces"][0]["nvPairs"][ "PORT_DUPLEX_MODE"] = delem[profile]["duplex"] + if delem[profile].get("disable_lacp_suspend_individual"): + intf["interfaces"][0]["nvPairs"]["DISABLE_LACP_SUSPEND"] = delem[profile]["disable_lacp_suspend_individual"] + else: + intf["interfaces"][0]["nvPairs"]["DISABLE_LACP_SUSPEND"] = False if delem[profile]["mode"] == "access": if delem[profile]["members"] is None: intf["interfaces"][0]["nvPairs"]["MEMBER_INTERFACES"] = "" @@ -2945,6 +2957,10 @@ def dcnm_intf_get_pc_payload(self, delem, intf, profile): "ENABLE_MONITOR"] = delem[profile]["enable_monitor"] intf["interfaces"][0]["nvPairs"][ "PORT_DUPLEX_MODE"] = delem[profile]["duplex"] + if delem[profile].get("disable_lacp_suspend_individual"): + intf["interfaces"][0]["nvPairs"]["DISABLE_LACP_SUSPEND"] = delem[profile]["disable_lacp_suspend_individual"] + else: + intf["interfaces"][0]["nvPairs"]["DISABLE_LACP_SUSPEND"] = False if delem[profile]["mode"] == "l3": if delem[profile]["members"] is None: intf["interfaces"][0]["nvPairs"]["MEMBER_INTERFACES"] = "" From a4160c37f43c698b238069674aa30c1acc4c68fd Mon Sep 17 00:00:00 2001 From: mkilar Date: Wed, 13 Aug 2025 16:27:31 +0200 Subject: [PATCH 2/2] modifying test files --- tests/unit/modules/dcnm/test_dcnm_intf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/modules/dcnm/test_dcnm_intf.py b/tests/unit/modules/dcnm/test_dcnm_intf.py index 30b888819..71112f890 100644 --- a/tests/unit/modules/dcnm/test_dcnm_intf.py +++ b/tests/unit/modules/dcnm/test_dcnm_intf.py @@ -2997,6 +2997,7 @@ def test_dcnm_intf_pc_replaced_existing(self): "ROUTING_TAG", "SPEED", "CONF", + "DISABLE_LACP_SUSPEND" ] for d in result["diff"][0]["replaced"]: