Skip to content

HOWTO: Use NetBox as Source of Truth for Ansible and Nornir

Establishes NetBox as the authoritative inventory source for Ansible and Nornir — the pattern that prevents automation tools from owning device truth. Covers site, tenant, VLAN, and device role modelling in NetBox; an exporter that renders Ansible and Nornir inventory YAML from the API; and CI/CD wiring that fails fast when NetBox is stale. The same export feeds environment guard checks for orphaned devices and tag drift.

What this covers:

  • NetBox site, device, VLAN, and prefix modelling aligned with ADR-0101 and ADR-0002
  • Inventory exporter producing both Ansible and Nornir YAML from a single NetBox query
  • CI/CD integration with inventory freshness validation and orphan detection

Learn this in Academy: IPAM-Driven Infrastructure track