VPC Pair 4.x Implementation#197
VPC Pair 4.x Implementation#197sivakasi-cisco wants to merge 45 commits intoCiscoDevNet:nd42_integrationfrom
Conversation
|
Continuation of sivakasi-cisco#1 |
This reverts commit 565a069.
This reverts commit e14537f.
…sible-nd into vpc_pair_4x_nd # Conflicts: # plugins/models/model_playbook_vpc_pair.py # plugins/module_utils/endpoints/v1/manage_vpc_pair/model_playbook_vpc_pair.py # plugins/module_utils/manage/vpc_pair/model_playbook_vpc_pair.py
…sible-nd into vpc_pair_4x_nd
plugins/module_utils/endpoints/v1/manage_vpc_pair/vpc_pair_endpoints.py
Outdated
Show resolved
Hide resolved
plugins/module_utils/endpoints/v1/manage/vpc_pair_base_paths.py
Outdated
Show resolved
Hide resolved
| - VpcPairResourceService handles NDStateMachine orchestration | ||
| - Custom actions use RestSend (NDModuleV2) for HTTP with retry logic | ||
| """ | ||
| argument_spec = dict( |
There was a problem hiding this comment.
We decided that it would be better to include this as part of our pydantic models and update argument_spec from the model.
Here is an example:
This should be added to the pydantic model that represents your playbook configuration. I did not see one for your playbook configuration so for now you could add it to the vpc_pair_models.py file but we should discuss adding a pydantic model the represents the playbook config the user would provide.
| ) | ||
|
|
||
| # State-specific parameter validations | ||
| state = module.params.get("state", "merged") |
There was a problem hiding this comment.
Curious why you default to merged here since the argument spec above already defaults state to merged?
| deploy = module.params.get("deploy") | ||
| dry_run = module.params.get("dry_run") | ||
|
|
||
| if state == "gathered" and deploy: |
There was a problem hiding this comment.
We need to discuss this more for this module but state: gathered must adhere to the playbook ansible argument spec so that it can be cut an pasted into a playbook
This should follow the Ansible argspec and if used in a playbook with state overridden would result in no changes to the controller
There was a problem hiding this comment.
Let's discuss alternatives to what you are doing since I believe you are using your current version of state: gathered for testing
| ), | ||
| ) | ||
|
|
||
| module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True) |
There was a problem hiding this comment.
You should not need a separate dry_run parameter in the playbook. When you instantiate your module here using the supports_check_mode option you should be able to check using
if module.check_mode:
<handle check_mode code>07df339 to
1ba1cf7
Compare
47f5bb0 to
ea2e89c
Compare
vPC Pair support for ND 4.x
nd_manage_vpc_pair can create, update, delete, override, and gather vPC pairs.
The big module logic was split into focused helper files (query, validation, actions, deploy, etc.)
We added dedicated vPC Pair endpoints/models/schemas and connected them through the orchestrator + state machine flow.
Integration tests were added across all main scenarios (merge/replace/override/delete/gather).