Skip to content

nd_interface_vpc_access#279

Open
allenrobel wants to merge 3 commits into
nd_vpc_pairfrom
nd_interface_vpc_access
Open

nd_interface_vpc_access#279
allenrobel wants to merge 3 commits into
nd_vpc_pairfrom
nd_interface_vpc_access

Conversation

@allenrobel
Copy link
Copy Markdown
Collaborator

Related Issue(s)

Proposed Changes

  • Adds the nd_interface_vpc_access module, which manages vPC accessVpcHost interfaces (template int_vpc_access_host) on Cisco Nexus Dashboard.
  • Adds AccessVpcHostPolicyTypeEnum to plugins/module_utils/models/interfaces/enums.py so the model can frozen-pin its policy_type.
  • Inherits all CRUD, peer-serial resolution, per-interface DELETE, and query_all dedupe from VpcBaseOrchestrator (introduced in the stack-parent PR).

Access-specific design (lab-verified on ND 4.2.1):

  • Single user-facing access_vlan field fans out to peer1AccessVlan / peer2AccessVlan at payload-serialization time via a @model_serializer. ND collapses both per-peer keys back to a single accessVlan in the GET response, so the round-trip matches the wire echo without further normalization. Tagged TODO(4.2.1).
  • Per-peer peer1/peer2 member_ports / port_channel_id / port_channel_description / port_channel_configuration are exposed (the OpenAPI schema preserves these on read).
  • identifier_strategy = "single" on interface_name; switch_ip is routing-only and excluded from diff/payload because ND echoes the same vPC record from BOTH peers' /interfaces GETs.

Test Notes

  • Unit tests across model + orchestrator + fixture JSON: python -m pytest tests/unit/module_utils/models/test_vpc_access_interface.py tests/unit/module_utils/orchestrators/test_vpc_access_interface.py -q. Full repo suite stays green (926 pass, no regressions).
  • Integration target tests/integration/targets/nd_interface_vpc_access/ with merged / replaced / overridden / deleted state coverage, exercised against ND 4.2.1 on the SITE1 lab (S1_LE1 / S1_LE2): ansible-test integration --docker nd_interface_vpc_access -vv.
  • ansible-test sanity --docker default --python 3.11 passes on the changed files.
  • Wire round-trip verified live: writing peer1AccessVlan + peer2AccessVlan returns 207 success; GET echoes a single accessVlan matching what the model exposes.

Cisco Nexus Dashboard Version

4.2.1

Related ND API Resource Category

  • analyze
  • infa
  • manage
  • onemanage
  • other

Checklist

  • Latest commit is rebased from develop with merge conflicts resolved
  • New or updates to documentation has been made accordingly
  • Assigned the proper reviewers

@allenrobel allenrobel self-assigned this May 13, 2026
@allenrobel allenrobel changed the title nd_interface_vpc_access module nd_interface_vpc_access May 13, 2026
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from b03db99 to c3c54fd Compare May 14, 2026 03:11
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from c3c54fd to 2e09054 Compare May 14, 2026 18:42
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 2e09054 to 0ddf68c Compare May 14, 2026 20:44
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 0ddf68c to 9228400 Compare May 20, 2026 21:23
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 9228400 to 82a2549 Compare May 21, 2026 19:41
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from 09aa4bd to a0c2186 Compare May 22, 2026 03:01
@allenrobel allenrobel force-pushed the nd_interface_vpc_access branch from a0c2186 to 31b969d Compare May 22, 2026 03:14
allenrobel and others added 3 commits May 22, 2026 07:12
Scaffolding for the nd_interface_vpc_access module: policy type literal for the
int_vpc_access_host template, hardcoded into the feature model per the
per-policy module convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Manages vPC accessVpcHost interfaces (template int_vpc_access_host) on
Cisco Nexus Dashboard, inheriting CRUD, peer-serial resolution,
per-interface DELETE, and query_all dedupe from VpcBaseOrchestrator.

Access-specific design:

- Single user-facing access_vlan field that fans out to peer1AccessVlan /
  peer2AccessVlan at payload-serialization time. ND collapses both per-peer
  keys back to a single accessVlan in the GET response, so the round-trip
  matches the wire echo without further normalization. Marked TODO(4.2.1)
  on the model_serializer.
- Keeps per-peer peer1/peer2 member_ports / port_channel_id /
  port_channel_description / port_channel_configuration as the OpenAPI
  schema preserves these on read.
- Identifier strategy is single (interface_name only); switch_ip is
  routing-only and excluded from diff/payload because ND echoes the same
  vPC record from BOTH peers' /interfaces GETs.

Includes:

- AccessVpcHostInterfaceModel (model) + AccessVpcHostInterfaceOrchestrator
  (~50-line VpcBaseOrchestrator subclass that sets model_class and returns
  {"accessVpcHost"} for _managed_policy_types).
- Unit tests (model + orchestrator + fixture JSON).
- Integration target with merged / replaced / overridden / deleted state
  blocks; vPC pair setup/teardown via nd_vpc_pair.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
YAML 1.1 parses an unquoted `on` as the boolean True, so the
DOCUMENTATION block's `choices: [ on, active, passive ]` resolved to
`[True, 'active', 'passive']` while the argument_spec correctly used
the string 'on'. This tripped two ansible-test validate-modules
checks: doc-choices-do-not-match-spec and doc-choices-incompatible-type.

Quote 'on' so the documented choices parse as strings and match the spec.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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