Ansible ND 4.X | WIP | ND Manage Switches Module + Pydantic Models + Smart Endpoints#198
Ansible ND 4.X | WIP | ND Manage Switches Module + Pydantic Models + Smart Endpoints#198AKDRG wants to merge 30 commits intoCiscoDevNet:nd42_integrationfrom
Conversation
…ible-nd into switch_int_pr
plugins/module_utils/endpoints/v1/manage/nd_manage_switches/credentials.py
Outdated
Show resolved
Hide resolved
plugins/module_utils/endpoints/v1/manage/nd_manage_switches/credentials.py
Outdated
Show resolved
Hide resolved
plugins/module_utils/endpoints/v1/manage/nd_manage_switches/credentials.py
Outdated
Show resolved
Hide resolved
plugins/module_utils/endpoints/v1/manage/nd_manage_switches/credentials.py
Outdated
Show resolved
Hide resolved
plugins/module_utils/endpoints/v1/manage/nd_manage_switches/credentials.py
Outdated
Show resolved
Hide resolved
plugins/module_utils/endpoints/v1/manage/nd_manage_switches/fabric_bootstrap.py
Outdated
Show resolved
Hide resolved
plugins/module_utils/endpoints/v1/manage/nd_manage_switches/fabric_bootstrap.py
Outdated
Show resolved
Hide resolved
…ible-nd into switch_int_pr
|
|
||
| # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
| """ | ||
| ND Manage Fabric Config endpoint models. |
There was a problem hiding this comment.
There is some overlap here with the fabric module endpoints so we should discuss consolidation and moving things like config-save and config-deploy to a more common location instead of under nd_manage_switches
plugins/module_utils/models/nd_manage_switches/bootstrap_models.py
Outdated
Show resolved
Hide resolved
|
|
||
| from ansible_collections.cisco.nd.plugins.module_utils.nd_v2 import NDModule | ||
| from ansible_collections.cisco.nd.plugins.module_utils.enums import OperationType | ||
| from ansible_collections.cisco.nd.plugins.module_utils.nd_output import NDOutput |
There was a problem hiding this comment.
Notes about NDOutput behavior from my discussion today
- Before and after state can contain read-only properties (things like config-sync state)
- After by default should include a query of the fabric at the end to reflect updated state
- Explore control knobs to improve performance and not have to query at the end for after state
Don't worry about the control knobs for now. We can do that in a subsequent update.
There was a problem hiding this comment.
Most of the changes have been integrated. Query for "after " and performance control knob is being explored.
| - C(merged) and C(query) are the only states supported for POAP. | ||
| - C(merged) is the only state supported for RMA. | ||
| type: str | ||
| default: merged |
There was a problem hiding this comment.
We discussed that it would be good to support state: gathered
This should follow the Ansible argspec and if used in a playbook with state overridden would result in no changes to the controller
This IMO can be a subsequent update to the module
There was a problem hiding this comment.
Gathered is now supported in the module.
…e Handling for POAP, Preprovision Skip Discovery for Existing Switches
…MA, POAP, Normal Discovery handling in same task.
| - Please note that the existing switch should be configured and deployed in maintenance mode. | ||
| - Please note that the existing switch being replaced should be shutdown state or out of network. |
There was a problem hiding this comment.
These contradict each other a bit; I'll draft something to help reword.
There was a problem hiding this comment.
Have reworded this, please check and let me know if we need to change.
…ible-nd into switch_int_pr
This PR introduces the initial implementation of ND Manage switch lifecycle support in the cisco.nd collection.
It adds a new switch management resource layer, endpoint wrappers, Pydantic model hierarchy, utility helpers.
What’s Included
Added a full resource engine in plugins/module_utils/nd_switch_resources.py
Implements state handling for:
Adds structured operation sequencing:
Added endpoint models under plugins/module_utils/endpoints/v1/nd_manage_switches:
Added shared model base and nested infrastructure:
Added model consolidation in:
plugins/module_utils/models/nd_manage_switches/summary_models.py
Added helpers in plugins/module_utils/utils/nd_manage_switches:
These utilities centralize grouping, payload shaping, wait/retry logic, and fabric operations.