Skip to content

Ansible ND 4.X | WIP | ND Manage Switches Module + Pydantic Models + Smart Endpoints#198

Open
AKDRG wants to merge 1 commit intoCiscoDevNet:nd42_integrationfrom
AKDRG:switch_int_pr
Open

Ansible ND 4.X | WIP | ND Manage Switches Module + Pydantic Models + Smart Endpoints#198
AKDRG wants to merge 1 commit intoCiscoDevNet:nd42_integrationfrom
AKDRG:switch_int_pr

Conversation

@AKDRG
Copy link

@AKDRG AKDRG commented Mar 11, 2026

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

  1. New switch lifecycle resource implementation

Added a full resource engine in plugins/module_utils/nd_switch_resources.py
Implements state handling for:

  • query
  • merged
  • overridden
  • deleted
  • POAP flows (bootstrap, pre-provision, serial swap)
  • RMA flow

Adds structured operation sequencing:

  • discovery
  • add/remove
  • role updates
  • credentials save
  • wait-for-manageability
  • save/deploy finalize
  1. ND Manage endpoint layer

Added endpoint models under plugins/module_utils/endpoints/v1/nd_manage_switches:

  • manage_credentials.py
  • manage_fabric_bootstrap.py
  • manage_fabric_config.py
  • manage_fabric_discovery.py
  • manage_fabric_switch_actions.py
  • manage_fabric_switches.py
  1. Pydantic model framework and nd_manage_switches models

Added shared model base and nested infrastructure:

  • plugins/module_utils/models/base.py
  • plugins/module_utils/models/nested.py
  • Added nd_manage_switches model package and exports:
  • bootstrap, config, discovery, preprovision, rma, switch_actions, switch_data, enums, validators
  • package-level init re-exports for consistent imports

Added model consolidation in:
plugins/module_utils/models/nd_manage_switches/summary_models.py

  1. Utilities for lifecycle orchestration
    Added helpers in plugins/module_utils/utils/nd_manage_switches:
  • bootstrap_utils.py
  • fabric_utils.py
  • payload_utils.py
  • switch_helpers.py
  • switch_wait_utils.py
  • exceptions.py

These utilities centralize grouping, payload shaping, wait/retry logic, and fabric operations.

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.

1 participant