ADR: NetBox Device Type Library Import Automation
Summary
Automate NetBox device type imports from netbox-community/devicetype-library
rather than maintaining manual device type definitions. All TheBurrow hardware
exists in the community library. Import is idempotent and fully recoverable
after a NetBox rebuild.
Status: Accepted Date: 2026-05-30 Implementation: mistborn-ops/netbox-tools
Context
NetBox requires device type definitions before devices can be created. Device types encode manufacturer, model, interface counts, power specs, and form factor. TheBurrow has the following hardware requiring definitions:
- Protectli Vault V1610 (nevermore)
- Raspberry Pi 4B x5 (mistborn, fablehaven, hogwarts, locker9, conair)
- Raspberry Pi 3B+ x1 (cosmere)
- Buffalo LinkStation LS220D (the-archive)
- TP-Link Deco M5 x3 (union-station, weasleyhallway, prefectbedroom)
- AT&T BGW320-500 (The Veil)
All of these exist in the netbox-community/devicetype-library — the
de facto standard community repository with 14,000+ device type
definitions, actively maintained, and used by the majority of NetBox
deployments globally.
Options Evaluated
| Category | Weight | Option A: Automate | Option B: Manual |
|---|---|---|---|
| Security posture | 5 | 4 — community repo via scoped API token; idempotent | 5 — no external dependency |
| Ops complexity | 4 | 4 — one script run, idempotent reruns | 2 — manual entry per type, error-prone |
| Reliability / maturity | 4 | 5 — de facto standard, 14k+ types | 3 — human error risk on interface counts |
| Ansible deployability | 4 | 5 — trivially scriptable via NetBox API | 1 — not automatable |
| Resource footprint | 3 | 5 — API calls only, no new service | 5 — same |
| Community / docs | 2 | 5 — actively maintained, well documented | 3 — NetBox docs cover manual entry |
Weighted scores:
- Option A (Automate): 101
- Option B (Manual): 70
Decision
Option A — Automate imports from netbox-community/devicetype-library.
Manual entry is error-prone for interface counts and specs, not repeatable, and not recoverable after a NetBox rebuild without re-entering everything by hand. The community library covers all TheBurrow hardware. Import is idempotent — running it again after a rebuild restores all device types without manual intervention.
The only meaningful argument for manual is no external dependency. Mitigated by: imports are read-only at run time, the API token used is scoped to device type writes only, and the library is cloned locally before import (no runtime internet dependency).
Implementation
Tool
netbox-community/devicetype-library provides a bundled import script
(import.py) that reads YAML definitions and creates device types via
the NetBox API. Runs as a one-shot script, not a persistent service.
Scope
Import only the device types TheBurrow actually uses:
Protectli/V1610.yamlRaspberry Pi/RPi-4B.yamlRaspberry Pi/RPi-3B+.yamlBuffalo/LS220D.yamlTP-Link/Deco-M5.yamlAT&T/BGW320-500.yaml
Token scope
Dedicated read/write token scoped to device type objects only.
Stored in Ansible Vault under vault_netbox_devicetype_token.
Execution
Run manually on demand — initial population and after NetBox rebuild. Not scheduled. Device types change rarely.
Location
Script and device type manifest live in mistborn-ops/netbox-tools.
Consequences
Positive
- Device types match manufacturer specifications exactly
- Fully recoverable after NetBox rebuild — re-run the script
- No manual interface count entry — eliminates a common error source
- Extensible — adding new hardware means adding one YAML path
Negative
- External dependency on
netbox-community/devicetype-libraryat import time (mitigated by local clone) - Requires a dedicated API token with device type write scope
Alternatives Considered
Manual entry only
Rejected — not repeatable, not recoverable, error-prone for interface counts and power specs. Every NetBox rebuild requires re-entering all device types by hand.
Related
- mistborn-ops/ansible#95 — original decision issue
- mistborn-ops/netbox-tools — implementation home
- mistborn-ops/ansible#543 — topology population (uses device types)