Skip to content

add support for disable_lacp_suspend_individual for non-vpc port-channels #494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/cisco.dcnm.dcnm_interface_module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,27 @@ Parameters
<div>Description of the interface</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td class="elbow-placeholder"></td>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>disable_lacp_suspend_individual</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">boolean</span>
</div>
</td>
<td>
<ul style="margin: 0; padding: 0"><b>Choices:</b>
<li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
<li>yes</li>
</ul>
</td>
<td>
<div>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</div>
</td>
</tr>
<tr>
<td class="elbow-placeholder"></td>
<td class="elbow-placeholder"></td>
Expand Down
16 changes: 16 additions & 0 deletions plugins/modules/dcnm_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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"] = ""
Expand Down Expand Up @@ -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"] = ""
Expand Down
1 change: 1 addition & 0 deletions tests/unit/modules/dcnm/test_dcnm_intf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down