Intent with Nornir / NAPALM
Do not use for one-off show commands. Not for Ansible-vs-Nornir debates.
Procedure
- Inventory from NetBox (nornir-netbox). Filters are site, role, platform — never a handwritten host list.
- Render Jinja from intent data. No device-specific if-hacks if a platform plugin exists.
- NAPALM
get_config+compare_configbefore commit. Print the diff in the ticket. - Idempotence: a second run produces an empty diff.
- Verify on a canary device, then the rest, with change-guard.
from nornir_napalm.plugins.tasks import napalm_configure
r = nr.filter(site="dc1", role="leaf").run(task=napalm_configure, dry_run=True, filename="evpn.j2")
Anti-patterns
- Never
send_commanda config snippet that cannot be diffed. - Do not keep a parallel YAML inventory "just in case".
Safety
dry_run is the default. commit is change-guarded.