NetAuto Academy

NetBox / Source of Truth

Why Model Your Network as Data? The Source-of-Truth Problem

Advanced11 min read

What you'll learn

  • The real limitation of hand-maintained inventory files at scale
  • What 'source of truth' means as a data-modeling problem, not an execution problem
  • A preview, real and verified, of what this module builds toward
  • That this module is not about re-executing tasks -- it's about where inventory comes from
🎓 Teach This Lesson

Listen to a guided explanation of this lesson.

Spoken narration isn't supported in this browser.

Every fleet so far has lived in one file, maintained by hand

A different kind of problem than execution

Nornir (Phase 3.4) answers how do I execute across many devices. NAPALM (Phase 3.5) answers how do I normalize what I get back. Multi-vendor Automation (Phase 3.6) answers how do I select the right driver automatically. None of them ever asked: where does the list of devices itself come from? Every one of them read hosts.yaml, written by a person, by hand.

Static inventory -- every module since Phase 2.6
  1. hosts.yaml / devices.csvwritten and updated by hand
  2. Adding a deviceedit the file, redeploy it everywhere it's used
  3. No relationships, no query languagejust rows
NetBox -- a real source of truth
  1. Structured recordssites, devices, interfaces, IPs -- related, not flat
  2. Adding a deviceone record, in one place
  3. Every automation script reads the same live source
Quick checkConcept check
What question does this module answer that Nornir, NAPALM, and Multi-vendor Automation never asked?

A real, verified preview

What this module proves, concretely, by its capstone

This isn't a promise -- it's already been verified in this authoring environment. Adding one device record to a NetBox-shaped backend, with zero local YAML file touched, changes what a real Nornir inventory plugin loads on the very next run.

output — real, verified (Lesson 6 builds this in full)
Before adding a device to NetBox: ['SW1', 'SW2', 'SW3']
After adding SW4 in NetBox (no local file changed): ['SW1', 'SW2', 'SW3', 'SW4']

Real, verified output. No hosts.yaml existed anywhere in this test -- the inventory came entirely from NetBox records, and grew the moment a new record was added.

Quick checkPredict output
Based on the real, verified output above, what would a learner need to do to add SW4 to a NetBox-backed Nornir inventory?

What this module reuses, and what's genuinely new

Not re-taught here

InitNornir(), nr.run(), filtering, and concurrency (Phase 3.4) are assumed known. get_facts()/get_interfaces() and NAPALM's normalized shapes (Phase 3.5) are assumed known. nornir_napalm and automatic driver selection (Phase 3.6) are assumed known. This module adds exactly one new layer underneath all of them: where the inventory itself comes from.

Quick checkScenario
A learner expects this module to re-explain nr.run() or get_facts() from scratch. What should they expect instead?
Quick checkConcept check
Is 'source of truth' primarily about running automation faster or more reliably?

Key takeaways

  • Every module since Phase 2.6 has assumed a correct, hand-maintained hosts.yaml already exists -- this module questions that assumption directly.
  • Source of truth means one authoritative, structured, queryable place inventory comes from -- a data-modeling problem, not an execution problem.
  • A real, verified preview: adding one NetBox device record changed what a real Nornir inventory plugin loaded, with zero local file touched -- this module's capstone builds that in full.
  • Nornir, NAPALM, and nornir_napalm mechanics are all prerequisites here, reused not re-taught -- only the inventory source itself is new.