Automation · NetBox
NetBox Automation
Cheat sheet · https://pcornel.dk/topic.php?topic=5887
Answer
NetBox automation reads intended network state from NetBox via pynetbox, the REST API or Ansible's netbox inventory plugin, and pushes changes back, keeping NetBox the source of truth.
Remember
- pynetbox or REST API.
- Ansible inventory plugin.
- Write back status.
First checks
- Scripts/Reports (custom scripts) in NetBox — in-app automation
- Config contexts and config templates — rendering
- Ansible/Nornir with NetBox inventory — external automation
Verify in this order
NetBox data → scripts/templates/inventory → automation
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5887