Skip to content

Commit 56a8df9

Browse files
committed
adding LACP attributes port priority and rate v1
1 parent cfbb0d8 commit 56a8df9

File tree

3 files changed

+125
-1
lines changed

3 files changed

+125
-1
lines changed

docs/cisco.dcnm.dcnm_interface_module.rst

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,45 @@ Parameters
12861286
<div>Minimum Value (1), Maximum Value (31)</div>
12871287
</td>
12881288
</tr>
1289+
<tr>
1290+
<td class="elbow-placeholder"></td>
1291+
<td class="elbow-placeholder"></td>
1292+
<td colspan="1">
1293+
<div class="ansibleOptionAnchor" id="parameter-"></div>
1294+
<b>lacp_port_priority</b>
1295+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
1296+
<div style="font-size: small">
1297+
<span style="color: purple">integer</span>
1298+
</div>
1299+
</td>
1300+
<td>
1301+
<b>Default:</b><br/><div style="color: blue">32768</div>
1302+
</td>
1303+
<td>
1304+
<div>&lt;1-65535&gt; Set LACP port priority on member interfaces, default is 32768</div>
1305+
</td>
1306+
</tr>
1307+
<tr>
1308+
<td class="elbow-placeholder"></td>
1309+
<td class="elbow-placeholder"></td>
1310+
<td colspan="1">
1311+
<div class="ansibleOptionAnchor" id="parameter-"></div>
1312+
<b>lacp_rate</b>
1313+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
1314+
<div style="font-size: small">
1315+
<span style="color: purple">string</span>
1316+
</div>
1317+
</td>
1318+
<td>
1319+
<ul style="margin: 0; padding: 0"><b>Choices:</b>
1320+
<li><div style="color: blue"><b>normal</b>&nbsp;&larr;</div></li>
1321+
<li>fast</li>
1322+
</ul>
1323+
</td>
1324+
<td>
1325+
<div>Set the rate at which LACP control packets are sent to an LACP-supported interface. Normal rate (30 seconds), fast rate (1 second), rate is set on member interfaces, default is normal</div>
1326+
</td>
1327+
</tr>
12891328
<tr>
12901329
<td class="elbow-placeholder"></td>
12911330
<td class="elbow-placeholder"></td>
@@ -2441,6 +2480,45 @@ Parameters
24412480
<div>Enable lacp convergence for vPC port-channels</div>
24422481
</td>
24432482
</tr>
2483+
<tr>
2484+
<td class="elbow-placeholder"></td>
2485+
<td class="elbow-placeholder"></td>
2486+
<td colspan="1">
2487+
<div class="ansibleOptionAnchor" id="parameter-"></div>
2488+
<b>lacp_port_priority</b>
2489+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
2490+
<div style="font-size: small">
2491+
<span style="color: purple">integer</span>
2492+
</div>
2493+
</td>
2494+
<td>
2495+
<b>Default:</b><br/><div style="color: blue">32768</div>
2496+
</td>
2497+
<td>
2498+
<div>&lt;1-65535&gt; Set LACP port priority on member interfaces, default is 32768</div>
2499+
</td>
2500+
</tr>
2501+
<tr>
2502+
<td class="elbow-placeholder"></td>
2503+
<td class="elbow-placeholder"></td>
2504+
<td colspan="1">
2505+
<div class="ansibleOptionAnchor" id="parameter-"></div>
2506+
<b>lacp_rate</b>
2507+
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
2508+
<div style="font-size: small">
2509+
<span style="color: purple">string</span>
2510+
</div>
2511+
</td>
2512+
<td>
2513+
<ul style="margin: 0; padding: 0"><b>Choices:</b>
2514+
<li><div style="color: blue"><b>normal</b>&nbsp;&larr;</div></li>
2515+
<li>fast</li>
2516+
</ul>
2517+
</td>
2518+
<td>
2519+
<div>Set the rate at which LACP control packets are sent to an LACP-supported interface. Normal rate (30 seconds), fast rate (1 second), rate is set on member interfaces, default is normal</div>
2520+
</td>
2521+
</tr>
24442522
<tr>
24452523
<td class="elbow-placeholder"></td>
24462524
<td class="elbow-placeholder"></td>

plugins/modules/dcnm_interface.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,19 @@
196196
- State of Switchport Monitor for SPAN/ERSPAN
197197
type: bool
198198
default: false
199+
lacp_port_priority:
200+
description:
201+
- <1-65535> Set LACP port priority on member interfaces, default is 32768
202+
type: int
203+
default: 32768
204+
lacp_rate:
205+
description:
206+
- Set the rate at which LACP control packets are sent to an LACP-supported
207+
interface. Normal rate (30 seconds), fast rate (1 second), rate is set on member
208+
interfaces, default is normal
209+
type: str
210+
choices: ['normal', 'fast']
211+
default: normal
199212
profile_vpc:
200213
description:
201214
- Though the key shown here is 'profile_vpc' the actual key to be used in playbook
@@ -335,6 +348,19 @@
335348
- Enable lacp convergence for vPC port-channels
336349
type: bool
337350
default: false
351+
lacp_port_priority:
352+
description:
353+
- <1-65535> Set LACP port priority on member interfaces, default is 32768
354+
type: int
355+
default: 32768
356+
lacp_rate:
357+
description:
358+
- Set the rate at which LACP control packets are sent to an LACP-supported
359+
interface. Normal rate (30 seconds), fast rate (1 second), rate is set on member
360+
interfaces, default is normal
361+
type: str
362+
choices: ['normal', 'fast']
363+
default: normal
338364
profile_subint:
339365
description:
340366
- Though the key shown here is 'profile_subint' the actual key to be used in playbook
@@ -1963,6 +1989,8 @@ def __init__(self, module):
19631989
"ENABLE_ORPHAN_PORT": "orphan_port",
19641990
"DISABLE_LACP_SUSPEND": "disable_lacp_suspend_individual",
19651991
"ENABLE_LACP_VPC_CONV": "enable_lacp_vpc_convergence",
1992+
"LACP_PORT_PRIO": "lacp_port_priority",
1993+
"LACP_RATE": "lacp_rate",
19661994
"ENABLE_PFC": "enable_pfc",
19671995
"ENABLE_MONITOR": "enable_monitor",
19681996
"CDP_ENABLE": "enable_cdp",
@@ -2320,6 +2348,8 @@ def dcnm_intf_validate_port_channel_input(self, config):
23202348
enable_pfc=dict(type="bool", default=False),
23212349
duplex=dict(
23222350
type="str", default="auto", choices=["auto", "full", "half"]),
2351+
lacp_port_priority=dict(type="int", default=32768, range_min=1, range_max=65535),
2352+
lacp_rate=dict(type="str", default="normal"),
23232353
)
23242354

23252355
pc_prof_spec_access = dict(
@@ -2340,6 +2370,8 @@ def dcnm_intf_validate_port_channel_input(self, config):
23402370
enable_pfc=dict(type="bool", default=False),
23412371
duplex=dict(
23422372
type="str", default="auto", choices=["auto", "full", "half"]),
2373+
lacp_port_priority=dict(type="int", default=32768, range_min=1, range_max=65535),
2374+
lacp_rate=dict(type="str", default="normal"),
23432375
)
23442376

23452377
pc_prof_spec_l3 = dict(
@@ -2426,6 +2458,8 @@ def dcnm_intf_validate_virtual_port_channel_input(self, cfg):
24262458
admin_state=dict(type="bool", default=True),
24272459
disable_lacp_suspend_individual=dict(type="bool", default=False),
24282460
enable_lacp_vpc_convergence=dict(type="bool", default=False),
2461+
lacp_port_priority=dict(type="int", default=32768, range_min=1, range_max=65535),
2462+
lacp_rate=dict(type="str", default="normal"),
24292463
)
24302464

24312465
vpc_prof_spec_access = dict(
@@ -2912,6 +2946,8 @@ def dcnm_intf_get_pc_payload(self, delem, intf, profile):
29122946
"ENABLE_MONITOR"] = delem[profile]["enable_monitor"]
29132947
intf["interfaces"][0]["nvPairs"][
29142948
"PORT_DUPLEX_MODE"] = delem[profile]["duplex"]
2949+
intf["interfaces"][0]["nvPairs"]["LACP_PORT_PRIO"] = delem[profile]["lacp_port_priority"]
2950+
intf["interfaces"][0]["nvPairs"]["LACP_RATE"] = delem[profile]["lacp_rate"]
29152951
if delem[profile]["mode"] == "access":
29162952
if delem[profile]["members"] is None:
29172953
intf["interfaces"][0]["nvPairs"]["MEMBER_INTERFACES"] = ""
@@ -2945,6 +2981,8 @@ def dcnm_intf_get_pc_payload(self, delem, intf, profile):
29452981
"ENABLE_MONITOR"] = delem[profile]["enable_monitor"]
29462982
intf["interfaces"][0]["nvPairs"][
29472983
"PORT_DUPLEX_MODE"] = delem[profile]["duplex"]
2984+
intf["interfaces"][0]["nvPairs"]["LACP_PORT_PRIO"] = delem[profile]["lacp_port_priority"]
2985+
intf["interfaces"][0]["nvPairs"]["LACP_RATE"] = delem[profile]["lacp_rate"]
29482986
if delem[profile]["mode"] == "l3":
29492987
if delem[profile]["members"] is None:
29502988
intf["interfaces"][0]["nvPairs"]["MEMBER_INTERFACES"] = ""
@@ -3170,6 +3208,8 @@ def dcnm_intf_get_vpc_payload(self, delem, intf, profile):
31703208
intf["interfaces"][0]["nvPairs"]["ENABLE_LACP_VPC_CONV"] = delem[profile]["enable_lacp_vpc_convergence"]
31713209
else:
31723210
intf["interfaces"][0]["nvPairs"]["ENABLE_LACP_VPC_CONV"] = False
3211+
intf["interfaces"][0]["nvPairs"]["LACP_PORT_PRIO"] = delem[profile]["lacp_port_priority"]
3212+
intf["interfaces"][0]["nvPairs"]["LACP_RATE"] = delem[profile]["lacp_rate"]
31733213
intf["interfaces"][0]["nvPairs"]["INTF_NAME"] = ifname
31743214
intf["interfaces"][0]["nvPairs"]["SPEED"] = self.dcnm_intf_xlate_speed(
31753215
str(delem[profile].get("speed", ""))
@@ -4267,6 +4307,8 @@ def dcnm_intf_compare_want_and_have(self, state):
42674307
"CDP_ENABLE",
42684308
"DISABLE_LACP_SUSPEND",
42694309
"ENABLE_LACP_VPC_CONV",
4310+
"LACP_PORT_PRIO",
4311+
"LACP_RATE",
42704312
"ENABLE_MONITOR",
42714313
"ENABLE_ORPHAN_PORT",
42724314
"ENABLE_PFC",

tests/unit/modules/dcnm/test_dcnm_intf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2997,6 +2997,8 @@ def test_dcnm_intf_pc_replaced_existing(self):
29972997
"ROUTING_TAG",
29982998
"SPEED",
29992999
"CONF",
3000+
"LACP_PORT_PRIO",
3001+
"LACP_RATE"
30003002
]
30013003

30023004
for d in result["diff"][0]["replaced"]:
@@ -4224,7 +4226,9 @@ def test_dcnm_intf_vpc_replaced_existing(self):
42244226
"PEER2_PO_CONF",
42254227
"INTF_NAME",
42264228
"ENABLE_LACP_VPC_CONV",
4227-
"DISABLE_LACP_SUSPEND"
4229+
"DISABLE_LACP_SUSPEND",
4230+
"LACP_PORT_PRIO",
4231+
"LACP_RATE"
42284232
]
42294233

42304234
for d in result["diff"][0]["replaced"]:

0 commit comments

Comments
 (0)