Skip to content

Commit

Permalink
[minor_change] Added QoS Level to the mso_schema_template_external_ep…
Browse files Browse the repository at this point in the history
…g module
  • Loading branch information
sajagana authored and lhercot committed Jan 22, 2025
1 parent 031f918 commit 3158754
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions plugins/modules/mso_schema_template_external_epg.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@
description:
- Preferred Group is enabled for this External EPG or not.
type: bool
qos_level:
description:
- The QoS Level parameter is supported on versions of MSO/NDO that are 4.3 or greater.
- Defaults to C(unspecified) when unset during creation.
type: str
choices: [ unspecified, level1, level2, level3, level4, level5, level6 ]
state:
description:
- Use C(present) or C(absent) for adding or removing.
Expand Down Expand Up @@ -210,6 +216,7 @@ def main():
anp=dict(type="dict", options=mso_reference_spec()),
preferred_group=dict(type="bool"),
type=dict(type="str", default="on-premise", choices=["on-premise", "cloud"]),
qos_level=dict(type="str", choices=["unspecified", "level1", "level2", "level3", "level4", "level5", "level6"]),
state=dict(type="str", default="present", choices=["absent", "present", "query"]),
)

Expand Down Expand Up @@ -239,6 +246,7 @@ def main():
anp["template"] = anp.get("template").replace(" ", "")
preferred_group = module.params.get("preferred_group")
type_ext_epg = module.params.get("type")
qos_level = module.params.get("qos_level")
state = module.params.get("state")

mso = MSOModule(module)
Expand Down Expand Up @@ -307,6 +315,9 @@ def main():
else:
payload["l3outRef"] = l3out_ref

if qos_level:
payload["qosPriority"] = qos_level

mso.sanitize(payload, collate=True)

if mso.existing:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
schema: '{{ mso_schema | default("ansible_test") }}'
template: Template 1
vrf: VRF
preferred_group: true
#layer3_multicast: true
state: present

Expand Down Expand Up @@ -366,6 +367,7 @@
- cm_add_epg_again.current.vrfRef.templateName == "Template1"
- cm_add_epg_again.previous.vrfRef.vrfName == "VRF"
- cm_add_epg_again.current.vrfRef.vrfName == "VRF"
- cm_add_epg_again.current.qosPriority == "unspecified"
- cm_add_epg_again.previous.vrfRef.schemaId == cm_add_epg_again.current.vrfRef.schemaId


Expand Down Expand Up @@ -734,6 +736,7 @@
name: L3out2
schema: '{{ mso_schema | default("ansible_test") }}'
template: Template 1
qos_level: level5
state: present
register: nm_change_epg_1_l3out

Expand Down Expand Up @@ -761,10 +764,12 @@
- nm_change_epg_1_l3out is changed
- nm_change_epg_1_l3out.previous.vrfRef.vrfName == 'VRF'
- nm_change_epg_1_l3out.previous.vrfRef.templateName == 'Template1'
- nm_change_epg_1_l3out.previous.qosPriority == 'unspecified'
- nm_change_epg_1_l3out.current.vrfRef.vrfName == 'VRF2'
- nm_change_epg_1_l3out.current.vrfRef.templateName == 'Template1'
- nm_change_epg_1_l3out.current.l3outRef.l3outName == 'L3out2'
- nm_change_epg_1_l3out.current.l3outRef.templateName == 'Template1'
- nm_change_epg_1_l3out.current.qosPriority == 'level5'

- name: Change epg 4 preferredGroup(normal mode)
cisco.mso.mso_schema_template_external_epg:
Expand Down

0 comments on commit 3158754

Please sign in to comment.