-
Notifications
You must be signed in to change notification settings - Fork 107
Update aci_switch_policy_vpc_protection_group module (DCNE-465) #774
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
213d868
Update aci_switch_policy_vpc_protection_group module
netgirard 3974b72
Update tests to add vpc with pod ID
netgirard d9295de
Add author
netgirard 70f96e8
Update plugins/modules/aci_switch_policy_vpc_protection_group.py
netgirard af89478
Update aci_switch_policy_vpc_protection_group.py
netgirard 78edd08
Update plugins/modules/aci_switch_policy_vpc_protection_group.py
netgirard 77dbf85
Update main.yml
netgirard 6950e65
Update main.yml
netgirard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
# -*- coding: utf-8 -*- | ||
|
||
# Copyright: (c) 2017, Bruno Calogero <[email protected]> | ||
# Copyright: (c) 2025, Eric Girard @netgirard | ||
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
from __future__ import absolute_import, division, print_function | ||
|
@@ -40,6 +41,12 @@ | |
description: | ||
- The ID of the Second Leaf Switch for the Explicit vPC Protection Group. | ||
type: int | ||
pod_id: | ||
description: | ||
- The pod id of the VPC member nodes. | ||
- Accepted values range between C(1) and C(255). | ||
- The APIC defaults to C(1) when unset during creation. | ||
type: int | ||
state: | ||
description: | ||
- Use C(present) or C(absent) for adding or removing. | ||
|
@@ -62,6 +69,7 @@ | |
link: https://developer.cisco.com/docs/apic-mim-ref/ | ||
author: | ||
- Bruno Calogero (@brunocalogero) | ||
- Eric Girard (@netgirard) | ||
""" | ||
|
||
EXAMPLES = r""" | ||
|
@@ -224,6 +232,7 @@ def main(): | |
vpc_domain_policy=dict(type="str", aliases=["vpc_domain_policy_name"]), | ||
switch_1_id=dict(type="int"), | ||
switch_2_id=dict(type="int"), | ||
pod_id=dict(type="int"), | ||
state=dict(type="str", default="present", choices=["absent", "present", "query"]), | ||
name_alias=dict(type="str"), | ||
) | ||
|
@@ -242,6 +251,7 @@ def main(): | |
vpc_domain_policy = module.params.get("vpc_domain_policy") | ||
switch_1_id = module.params.get("switch_1_id") | ||
switch_2_id = module.params.get("switch_2_id") | ||
pod_id = module.params.get("pod_id") | ||
state = module.params.get("state") | ||
name_alias = module.params.get("name_alias") | ||
|
||
|
@@ -271,13 +281,15 @@ def main(): | |
fabricNodePEp=dict( | ||
attributes=dict( | ||
id="{0}".format(switch_1_id), | ||
podId=pod_id, | ||
), | ||
), | ||
), | ||
dict( | ||
fabricNodePEp=dict( | ||
attributes=dict( | ||
id="{0}".format(switch_2_id), | ||
podId=pod_id, | ||
), | ||
), | ||
), | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Test code for the ACI modules | ||
# Copyright: (c) 2017, Bruno Calogero <[email protected]> | ||
# Copyright: (c) 2025, Eric Girard <@netgirard> | ||
|
||
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
|
||
|
@@ -212,3 +213,44 @@ | |
- cm_query_non_vpc_prot_grp is not changed | ||
- nm_query_non_vpc_prot_grp is not changed | ||
- cm_query_non_vpc_prot_grp == nm_query_non_vpc_prot_grp | ||
|
||
# ADD VPC PROTECTION GROUP WITH POD | ||
netgirard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Add vpc protection group with pod ID (check_mode) | ||
cisco.aci.aci_switch_policy_vpc_protection_group: | ||
<<: *aci_switch_policy_vpc_protection_group_present | ||
pod_id: 2 | ||
check_mode: true | ||
register: cm_add_vpc_prot_grp_pod | ||
|
||
- name: Add vpc protection group with pod ID (normal mode) | ||
cisco.aci.aci_switch_policy_vpc_protection_group: | ||
<<: *aci_switch_policy_vpc_protection_group_present | ||
pod_id: 2 | ||
register: nm_add_vpc_prot_grp_pod | ||
|
||
- name: Add vpc protection group with pod ID again (check_mode) | ||
cisco.aci.aci_switch_policy_vpc_protection_group: | ||
<<: *aci_switch_policy_vpc_protection_group_present | ||
pod_id: 2 | ||
check_mode: true | ||
register: cm_add_vpc_prot_grp_pod_again | ||
|
||
- name: Add vpc protection group with pod ID again (normal mode) | ||
cisco.aci.aci_switch_policy_vpc_protection_group: | ||
<<: *aci_switch_policy_vpc_protection_group_present | ||
pod_id: 2 | ||
register: nm_add_vpc_prot_grp_pod_again | ||
|
||
- name: Verify addvpc protection group with pod ID tasks | ||
ansible.builtin.assert: | ||
netgirard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
that: | ||
- cm_add_vpc_prot_grp_pod is changed | ||
- cm_add_vpc_prot_grp_pod.previous == [] | ||
- cm_add_vpc_prot_grp_pod.proposed.0.fabricExplicitGEp.children.0.fabricNodePEp.attributes.podId == '2' | ||
- cm_add_vpc_prot_grp_pod.proposed.0.fabricExplicitGEp.children.1.fabricNodePEp.attributes.podId == '2' | ||
- nm_add_vpc_prot_grp_pod is changed | ||
- nm_add_vpc_prot_grp_pod.current.0.fabricExplicitGEp.children.0.fabricNodePEp.attributes.podId == '2' | ||
- nm_add_vpc_prot_grp_pod.current.0.fabricExplicitGEp.children.1.fabricNodePEp.attributes.podId == '2' | ||
- nm_add_vpc_prot_grp_pod.current.0.fabricExplicitGEp.attributes.annotation == 'orchestrator:ansible' | ||
- cm_add_vpc_prot_grp_pod_again is not changed | ||
- nm_add_vpc_prot_grp_pod_again is not changed |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.