Skip to content

Addition of a new module for enhanced_lag_policy (DCNE-422) #768

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 14 commits into
base: master
Choose a base branch
from

Conversation

DevSinha13
Copy link
Collaborator

No description provided.

@github-actions github-actions bot changed the title Addition of a new module for enhanced_lag_policy Addition of a new module for enhanced_lag_policy (DCNE-422) May 30, 2025
state: query
register: query_all_result

- name: Ensure idempotency when creating an Enhanced LACP Policy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think we include this type of example in other modules

vm_provider: vmware
state: absent

- name: Simulate deletion of an Enhanced LACP Policy (Check Mode)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think we include this type of example in other modules

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, I have deleted that example. Thank you for the clarification.

argument_spec.update(
domain=dict(type="str", aliases=["domain_name", "domain_profile"]),
state=dict(type="str", default="present", choices=["absent", "present", "query"]),
vm_provider=dict(type="str", choices=list(VM_PROVIDER_MAPPING.keys())),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think the keys() is needed and list function can be called directly on the MAP

Suggested change
vm_provider=dict(type="str", choices=list(VM_PROVIDER_MAPPING.keys())),
vm_provider=dict(type="str", choices=list(VM_PROVIDER_MAPPING)),

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, removed the .keys() function and maintained functionality across all tests. Thanks for the feedback.

aci_owner_spec,
)

VM_PROVIDER_MAPPING = dict(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can import and use the VM_PROVIDER_MAPPING defined in module_utils/constants.py

number_uplinks: 4
state: present

- name: Simulate creation of an Enhanced LACP Policy (Check Mode)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dont think we include this type of example in other modules

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the thumbs up here? Has this been decided to include?

description:
- Manage Enhanced LACP Policy (lacpEnhancedLagPol) for VMM domains on Cisco ACI fabrics.
- The Enhanced LACP Policy allows you to configure advanced Link Aggregation Control Protocol (LACP) settings for virtual switches in VMM domains.
- This policy is a child of the C(vmmVSwitchPolicyCont) class.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is children something we decided to add to the descriptions?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the thumbs up here? Has this been decided?

DOCUMENTATION = r"""
---
module: aci_vmm_enhanced_lag_policy
short_description: Manage Enhanced LACP Policy for Virtual Machine Manager (VMM) in Cisco ACI
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other modules I think we include the classname to the short description (lacp:EnhancedLagPol) at the end. If not mistaken this was done for search-ability of classes in documentation

module: aci_vmm_enhanced_lag_policy
short_description: Manage Enhanced LACP Policy for Virtual Machine Manager (VMM) in Cisco ACI
description:
- Manage Enhanced LACP Policy (lacpEnhancedLagPol) for VMM domains on Cisco ACI fabrics.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think we put class names in the descriptions

@DevSinha13 DevSinha13 requested a review from akinross June 2, 2025 23:48
@gmicol gmicol requested a review from akinross June 5, 2025 18:27
description:
- Manage Enhanced LACP Policy (lacpEnhancedLagPol) for VMM domains on Cisco ACI fabrics.
- The Enhanced LACP Policy allows you to configure advanced Link Aggregation Control Protocol (LACP) settings for virtual switches in VMM domains.
- This policy is a child of the C(vmmVSwitchPolicyCont) class.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the thumbs up here? Has this been decided?

number_uplinks: 4
state: present

- name: Simulate creation of an Enhanced LACP Policy (Check Mode)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand the thumbs up here? Has this been decided to include?

aci_class="vmmVSwitchPolicyCont",
aci_rn="vswitchpolcont",
module_object="vswitchpolcont",
target_filter={"name": "vswitchpolcont"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would start by testing the behaviour with and without for both module_object and target_filter.

The target_filter is referencing a property now that exist but is not configurable according to the model, so is it always vswitchpolcont?

@DevSinha13 DevSinha13 requested a review from akinross June 10, 2025 22:37
- The I(vmm_domain) and I(vSwitch_policy) must exist before using this module in a playbook.
- The modules M(cisco.aci.aci_domain) and M(cisco.aci.aci_vmm_vswitch_policy) can be used for this.
seealso:
- module: cisco.aci.aci_domain
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- module: cisco.aci.aci_domain
- module: cisco.aci.aci_domain
- module: cisco.aci. aci_vmm_vswitch_policy

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that, I have made the fix

aci_class="vmmVSwitchPolicyCont",
aci_rn="vswitchpolcont",
module_object="vswitchpolcont",
target_filter={"name": "vswitchpolcont"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had a quick look and from what I read in code if module_object is defined that should be enough, target_filter is not used at all in the logic as far as I can tell so can be excluded, since it only uses the filter of the object defined in subclass_3. See _construct_url_4) function in aci.py

@DevSinha13 DevSinha13 requested a review from akinross June 11, 2025 18:58
akinross
akinross previously approved these changes Jun 12, 2025
Copy link
Collaborator

@akinross akinross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@DevSinha13 DevSinha13 force-pushed the feature/aci_enhanced_lag_policy branch from 3ab2f57 to bc2bc36 Compare June 12, 2025 18:40
@shrsr shrsr requested a review from akinross June 12, 2025 21:44
Copy link
Collaborator

@shrsr shrsr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a new module for enhanced lag policy for the VMM domain (aci_enhanced_lag_policy) (DCNE-422)
4 participants