Professional
NetBox / Source of Truth
Inventory as external, structured data -- pynetbox as a real REST client, safe reads and writes, and a real Nornir inventory plugin that builds your fleet dynamically from NetBox instead of a static YAML file.
Every project so far has read its device fleet from a file you maintained by hand -- a CSV or a static YAML inventory. This module replaces that file with NetBox, modeling your network as real structured data: sites, devices, interfaces, and IP addresses. You'll query NetBox with pynetbox as a genuine REST API client, extend the read-before-write discipline from earlier modules to safely create and update records, and -- the module's real payoff -- use a Nornir inventory plugin that builds your fleet dynamically from NetBox instead of a static file. This is the module where "source of truth" stops being an abstract term.
Next up
Why Model Your Network as Data? The Source-of-Truth Problem
0 / 6 completeLessons
- 1
Why Model Your Network as Data? The Source-of-Truth Problem
Every automation script since Phase 2.6 has read its fleet from a hand-maintained hosts.yaml or devices.csv. This lesson names the real limitation that creates, and previews what this module builds toward: adding a device in one place, automatically, without editing a static file.
Advanced11 min readNext up - 2
NetBox's Data Model: Sites, Devices, Interfaces, IP Addresses
NetBox's real device record shape, verified against the actual REST API structure nornir_netbox and pynetbox both consume -- and how it connects directly to the get_facts()/get_interfaces() shape NAPALM already taught.
Advanced12 min read - 3
pynetbox: Querying NetBox as a Real REST API Client
pynetbox 7.8.0, verified with its real signatures and real, executed output against a local, stdlib-only mock NetBox backend -- including a genuinely non-obvious API behavior around .get() with ambiguous results.
Advanced13 min read - 4
Writing Back Safely: Creating and Updating Records
pynetbox's real create() and update() operations, verified against the local mock backend, extending Phase 3.1's read-before-write discipline to the source of truth itself.
Advanced12 min read - 5
NetBox as Nornir's Inventory Source
nornir_netbox, verified directly -- including a genuine discovery (its older NBInventory class is deprecated) and a real, executed demonstration of NetBoxInventory2 building a working Nornir inventory, with auto-derived groups and a direct, verified path to a NAPALM-ready platform value.
Advanced15 min read - 6
Capstone: A Source-of-Truth-Driven Fleet Health Check
Every piece of this module -- NetBox records, pynetbox, a real Nornir inventory plugin, and nornir_napalm's task execution -- combined into one real, runnable pipeline, with a real, verified demonstration that adding a device in NetBox grows the automation fleet without touching a single local file.
Advanced18 min read
Practice this module
Apply what you just covered -- hands-on practice and a knowledge check for this module.