Skip to content

nd_interface_ethernet_access module#222

Draft
allenrobel wants to merge 4 commits intond_interface_loopbackfrom
nd_interface_ethernet_access
Draft

nd_interface_ethernet_access module#222
allenrobel wants to merge 4 commits intond_interface_loopbackfrom
nd_interface_ethernet_access

Conversation

@allenrobel
Copy link
Copy Markdown
Collaborator

Summary

  • Add nd_interface_ethernet_access Ansible module for managing ethernet accessHost interfaces on Nexus Dashboard
  • Fan-out playbook shape: interface_names list with shared config_data, expanded into flat items before the state machine
  • Shared EthernetBaseOrchestrator base class for all future ethernet interface modules (trunk, routed, breakout, freeform)
  • Port-channel membership enforcement with whitelisted modifiable fields (description, admin_state, extra_config)
  • Bulk normalize-based delete via interfaceActions/normalize with the int_trunk_host template defaults
  • InterfaceDefaultConfig model providing the full int_trunk_host normalize payload
  • EpManageInterfacesDelete and EpManageInterfacesNormalize endpoint classes
  • Integration tests for all four states: merged, replaced, overridden, deleted

Delete mechanism for physical ethernet interfaces

Physical ethernet interfaces cannot be deleted via the ND API:

  • interfaceActions/remove silently does nothing (returns success, config unchanged)
  • DELETE /interfaces/{name} returns HTTP 500: "Interface cannot be deleted!!!"
  • interfaceActions/normalize with policyType: accessHost also silently does nothing

The working mechanism: interfaceActions/normalize with the full int_trunk_host config template defaults (mode: "trunk", policyType: "trunkHost"). This resets the interface to fabric defaults and changes its policyType to trunkHost, which naturally removes it from the accessHost query_all() filter, enabling idempotent state: overridden.

Merge order

This PR must be merged AFTER nd_interface_loopback (PR #208). It is based on that branch and depends on the state machine, orchestrator base classes, fabric context, and endpoint infrastructure introduced there.

Unit tests

Unit tests are deferred until after Gaspard's bulk API handler is committed, which will change the orchestrator test patterns.

Test plan

  • Integration tests pass for state: merged (create, fan-out, idempotency, update, deploy:false)
  • Integration tests pass for state: replaced (full replace, fan-out, idempotency)
  • Integration tests pass for state: overridden (reduce, idempotency, swap, fan-out, non-accessHost filtering)
  • Integration tests pass for state: deleted (single, fan-out, idempotency, non-existent)
  • Unit tests (deferred — pending bulk API handler)

🤖 Generated with Claude Code

@allenrobel allenrobel marked this pull request as draft April 8, 2026 00:07
@allenrobel allenrobel changed the title Add nd_interface_ethernet_access module nd_interface_ethernet_access module Apr 8, 2026
mikewiebe and others added 4 commits April 8, 2026 09:56
#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>
…ace_loopback

# Conflicts:
#	plugins/module_utils/endpoints/v1/manage/manage_fabrics.py
Add Ansible module for managing ethernet accessHost interfaces on
Nexus Dashboard, with fan-out playbook shape, port-channel membership
enforcement, and bulk normalize-based delete for physical interfaces.

New files:
- Module: nd_interface_ethernet_access with expand_config() fan-out
- Model: EthernetAccessInterfaceModel with 19 accessHost policy fields
- Model: InterfaceDefaultConfig for int_trunk_host normalize payload
- Orchestrator: EthernetBaseOrchestrator (shared ethernet CRUD logic)
- Orchestrator: EthernetAccessInterfaceOrchestrator (thin subclass)
- Endpoints: EpManageInterfacesDelete, EpManageInterfacesNormalize
- Integration tests: merged, replaced, overridden, deleted states

Physical ethernet interfaces cannot be deleted via interfaceActions/remove
(silently does nothing) or DELETE (returns 500). The delete mechanism uses
interfaceActions/normalize with the int_trunk_host template defaults,
which resets interfaces to policyType: trunkHost, removing them from the
accessHost query filter and enabling idempotent state: overridden.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ntries

The DELETE endpoint does not work for physical ethernet interfaces (returns
HTTP 500). Updated docstring to reflect this and point to EpManageInterfacesNormalize.
Added missing EpManageInterfacesDelete and EpManageInterfacesNormalize to the
module-level endpoint list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@allenrobel allenrobel force-pushed the nd_interface_ethernet_access branch from 73c9b22 to 378c157 Compare April 8, 2026 19:43
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.

2 participants