Skip to content

fix(dtc): fail loud on pre_interface_freeform when NDFC/ND lacks preInterfaceConfig - #839

Open
dacasti2mx wants to merge 1 commit into
netascode:developfrom
dacasti2mx:fix/pre-interface-freeform-version-guard
Open

fix(dtc): fail loud on pre_interface_freeform when NDFC/ND lacks preInterfaceConfig#839
dacasti2mx wants to merge 1 commit into
netascode:developfrom
dacasti2mx:fix/pre-interface-freeform-version-guard

Conversation

@dacasti2mx

Copy link
Copy Markdown
Contributor

Related Issue(s)

Fixes #838

Related Collection Role

  • cisco.nac_dc_vxlan.dtc.create
  • other — cisco.nac_dc_vxlan.dtc.connectivity_check and the dtc.common freeform templates

Related Data Model Element

  • vxlan.global

Proposed Changes

On NDFC < 12.2.2 / ND <= 3.2.1 the fabric freeform templates version-gate out
preInterfaceConfig{Spine,Leaf,Tor}, which carry *_pre_interface_freeform (for example a
QoS policy-map). The dependent intra_fabric_link_freeform (for example the QoS
service-policy that references that policy-map) is still pushed unconditionally. The switch
then rejects the orphan service-policy with "cannot apply non-existing policy to interface",
and the fabric stays Out-of-Sync with no clear error (see #838).

This change:

  • connectivity_check: adds a single-source fact preinterface_config_supported, computed
    once where nd_version and ndfc_version are set (real boolean).
  • Freeform templates (iBGP and eBGP): gate preInterfaceConfig* on that fact instead of a
    duplicated inline version expression, so the two never drift.
  • create role: fails loud with an actionable message when *_pre_interface_freeform is set
    but the target version does not support it. The guard lives in create (not common) so
    remove/cleanup is never blocked.

Test Notes

  • Reproduced on ND 3.1.1n / NDFC 12.2.1.316: the original data model left the fabric
    Out-of-Sync (service-policy pending, no policy-map on the switch and in NDFC config-preview).
  • Guard fails in ~9s with a clear message, before any NDFC mutation. Verified it does not fire
    on supported versions or when no *_pre_interface_freeform is set.
  • Template gating verified both ways: unsupported -> no preInterfaceConfig emitted
    (service-policy still emitted, behavior unchanged); supported -> preInterfaceConfig present.
  • preinterface_config_supported verified to be a real boolean (not a "False" string).
  • ansible-playbook --syntax-check passes.

Cisco Nexus Dashboard Version

ND 3.1.1n (NDFC 12.2.1.316) for the failing case; supported path validated on ND 4.1.

Checklist

  • Latest commit is rebased from develop with merge conflicts resolved
  • New or updates to documentation has been made accordingly (n/a — no user-facing doc or schema change)
  • Assigned the proper reviewers

…nterfaceConfig

The fabric freeform templates only emit preInterfaceConfig{Spine,Leaf,Tor}
(carrying *_pre_interface_freeform, e.g. a QoS policy-map that must exist before
an interface references it) when NDFC >= 12.2.2 and ND > 3.2.1. On older
versions that config was silently dropped while the dependent
intra_fabric_link_freeform (e.g. the QoS service-policy) was still pushed,
leaving the fabric permanently Out-of-Sync ('cannot apply non-existing policy').

- connectivity_check: set single-source fact 'preinterface_config_supported'
- freeform templates (iBGP + eBGP): gate preInterfaceConfig on that fact
- create role: fail loud when *_pre_interface_freeform is set but unsupported
  (guard placed in create, not common, so remove/cleanup is never blocked)
@dacasti2mx
dacasti2mx requested a review from a team as a code owner July 16, 2026 01:22
@dacasti2mx dacasti2mx self-assigned this Jul 16, 2026
@dacasti2mx dacasti2mx added the wip work-in-progress label Jul 19, 2026
@juburnet juburnet added the 0.9.0 Release 0.9.0 label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.9.0 Release 0.9.0 wip work-in-progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pre_interface_freeform silently dropped on NDFC < 12.2.2 / ND <= 3.2.1 -> fabric stuck Out-of-Sync

2 participants