Skip to content

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

Open
AKDRG wants to merge 114 commits intoCiscoDevNet:developfrom
AKDRG:switch_int_pr
Open

Ansible ND 4.X | ND Manage Switches Module + Pydantic Models + Smart Endpoints#198
AKDRG wants to merge 114 commits intoCiscoDevNet:developfrom
AKDRG:switch_int_pr

Conversation

@AKDRG
Copy link
Copy Markdown
Collaborator

@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/manage_switches/nd_switch_resources.py
Implements state handling for:

  • gathered
  • merged
  • replaced
  • 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/:

  • manage_credentials_switches.py
  • manage_fabrics_actions.py
  • manage_fabrics_bootstrap.py
  • manage_fabrics_inventory.py
  • manage_fabrics_switchactions.py
  • manage_fabrics_switches.py
  • manage_fabrics.py
  1. Pydantic model framework and nd_manage_switches models
  • 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
  1. Utilities for lifecycle orchestration
    Added helpers in plugins/module_utils/manage_switches:
  • utils.py
  1. Unit Tests for the Endpoints and Integration Tests for the States supported by the Module.

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

@AKDRG AKDRG requested a review from allenrobel as a code owner April 5, 2026 19:39
@AKDRG AKDRG changed the title Ansible ND 4.X | WIP | ND Manage Switches Module + Pydantic Models + Smart Endpoints Ansible ND 4.X | ND Manage Switches Module + Pydantic Models + Smart Endpoints Apr 6, 2026
- Save/Recalculate the configuration of the fabric after inventory is updated.
type: bool
default: true
deploy:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We need to support separate save and deploy options

Use the following property structures

config_actions:
  save: true
  deploy: true
  type: switch [Enum Choices: switch and global]

If config_actions.save is false and config_actions.deploy is true we should fail

mikewiebe and others added 8 commits April 8, 2026 09:56
CiscoDevNet#209)

* Fabric modules for ibgp,ebgp,external fabrics

* Update ibgp model enums

* Update pydantic model and module docstrings for ibgp

* Update pydantic model for ebgp

* Update ebgp module doc headers

* Update enums and pydantic model descriptions for external fabrics

* Update ebgp module doc strings

* Fix ansible sanity tests failures

* Black formatting

* Move common models into common location for import

* Fix black formatting issue

* Add unit tests for fabric endpoints

* Fix ansible sanity test failures

* Test cleanup

* Add ibgp testing params

* Fix for merged state and tests

* Add more properties in ibgp merged test

* Add more properties in ibgp replaced test

* Refactor merged fix

* Change name property to fabric_name

* Add nd_info into integration tests

* remove underscore between un & numbered

* Address review comments

* Fix list behavior bug and update module docs

* Make ansible sanity happy

* Make netflow_exporter udp_port optional

* Organize ibgp module doc header

---------

Co-authored-by: Matt Tarkington <mtarking@cisco.com>
@mtarking mtarking deleted the branch CiscoDevNet:develop April 9, 2026 15:41
@mtarking mtarking closed this Apr 9, 2026
@mtarking mtarking reopened this Apr 9, 2026
@mtarking mtarking changed the base branch from nd42_integration to develop April 9, 2026 15:45
@AKDRG AKDRG requested review from akinross, mikewiebe and mtarking April 9, 2026 16:59
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.

7 participants