• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

Roger Perkin

Network Automation Architect

  • Network Automation
    • Network Automation Courses
    • Ansible Automation Platform
    • Ansible Workshop
    • What is Network Automation?
    • Network Automation Tools
    • ContainerLab
    • Ansible Training
      • What is Ansible Software?
      • Ansible Tutorial for Beginners
      • Ansible Network Automation
      • Ansible Hosts File
    • Python Network Automation
      • Nornir
      • Python Network Automation Course
      • Python for Network Engineers
      • Python VENV / Virtual Environment Tutorial
      • Python Tutorial for Beginners
      • pyATS
    • Network Source of Truth
      • NetBox Training
      • Infrahub
    • NetDevops
    • DevOps Tutorial
      • Git Training
      • Terraform Training
      • Linux Training
      • Kubernetes Training
      • Devops Training Course
      • Azure Devops Training
    • Terraform
    • GIT
      • Git Commands
      • What is GitHub?
    • Docker Training
    • Confluence
    • Microsoft Azure
  • Cisco
    • ISE
    • SD WAN Training
    • Password Recovery
    • Software-Upgrade-Guides
    • BGP
    • Data Center
    • WIRELESS
  • CCIE
  • Blog
  • About
    • My Red Special Guitar
  • Contact

Nornir vs Ansible

Home » Network Automation » Python Network Automation

Nornir vs Ansible

The main difference between Nornir and Ansible is that Nornir is a pure Python framework where everything you do is written in Python whilst Ansible which is also a Python based Framework requires you to write your playbooks in YAML. You do not need any Python knowledge to run Ansible, where you need to be quite knowledgeable in Python to run Nornir.

Nornir vs Ansible is a question I get asked all the time and it’s very valid, but whilst both are great network automation tools they both have their place depending on your use case and primarily skillset.

Nornir is an automation framework written in Python. Ansible is also an automation framework written in Python, however to use Nornir everything is driven from Python, whilst Ansible everything is driven by YAML playbooks.

While both tools tackle network automation tasks in a very different way Nornir is really for network engineers with a good understanding of Python, whilst Ansible requires no Python knowledge and is easier to get started with. Below I will discuss the pros and cons of each tool.

nornir logo Nornir is a Python Network Automation Framework
Nornir for Network Engineers Course
Python course

What is Nornir?

Nornir is a Python-based automation framework designed specifically for network automation tasks.

Nornir is 100% Python!

Nornir’s Core Capabilities

  • Nornir is a flexible, scalable, and straightforward Python-based automation framework optimized for network automation.
  • Nornir is pure Python so you are not dealing with a domain specific language like YAML so debugging is a lot easier.
  • It is lean and does not rely on external daemons or databases, making it lightweight and fast.
  • Nornir’s design philosophy revolves around being lightweight and direct, resulting in less overhead, faster execution, and fewer potential points of failure.
  • Being Python-based, Nornir allows users to leverage the extensive Python ecosystem, libraries, and custom scripts.
  • It offers a modular framework that allows integrating plugins or crafting bespoke solutions tailored to unique challenges.
  • Nornir stands out for its distinct approach to network task automation, providing a unique combination of speed, scalability, and flexibility.
  • Nornir is used primarlity for its speed, versatility, and ability to scrape data from hundreds of devices in seconds.
  • It is favored by users comfortable with Python programming and manipulating Python output.
  • However, Nornir’s reliance on Python programming can be a barrier for colleagues who are not programmers and prefer more user-friendly interfaces.
  • Nornir is not inherently idempotent, requiring additional effort to implement a read, compare, write strategy for idempotency.

Nornir Use Cases

  1. Automating configuration backups and snapshots across network devices
    Nornir can be used to create tasks that backup device configurations from routers, switches, firewalls etc. on a scheduled basis across your network infrastructure. This ensures you have up-to-date backups for auditing, compliance or recovery purposes.
  2. Rendering and pushing configurations using templates
    With Nornir’s integration with Jinja2 templates, you can pull data from sources like YAML files, render device configurations from templates, and then use plugins like NAPALM or Netmiko to push these configurations out to network devices.
  3. Data collection and analysis
    Nornir allows you to run show commands or gather operational data from network devices in parallel. This data can then be analyzed, processed and fed into other systems for monitoring, reporting or troubleshooting purposes.
  4. Network validation and compliance checks
    You can build Nornir tasks to validate device configurations against defined policies/standards and identify any deviations. This ensures network-wide configuration consistency.
  5. Zero-touch provisioning and deployment
    Nornir’s inventory capabilities combined with its task execution framework enables zero-touch provisioning of new network devices by automatically deploying configurations during device rollouts or replacements.

The multi-vendor support, parallelism, extensibility through plugins, and the ability to integrate with tools like NetBox make Nornir a powerful framework for automating a wide variety of network operations and workflows

Ansible vs Nornir

Ansible vs Nornir

What is Ansible?

Ansible’s Key Features

Nornir vs Ansible: Speed and Performance

Nornir vs Ansible: Infrastructure Management

Nornir and NetBox Integration

Nornir can integrate with NetBox through the use of the nornir_netbox library or plugin. Here are some key points about the Nornir-NetBox integration: Nornir allows you to pass configuration options like the NetBox URL when initializing it, for example:

nr = InitNornir(
    inventory={
        "plugin":"NetBoxInventory2",
        "options": {
            "nb_url": "https://netbox.local:8000",
            "nb_token": "1234567890"
        }
    }
)

This allows Nornir to connect to the specified NetBox instance. The nornir_netbox library provides a NetBoxInventory2 plugin that allows you to retrieve NetBox data like device and virtual machine information.

It exposes configuration options like the NetBox URL and API token. The nornir_netbox library is a separate library or plugin that facilitates the Nornir-NetBox integration, allowing you to pass in options like the NetBox URL and API token when initializing Nornir.

In summary, by leveraging the nornir_netbox library or plugin, you can integrate Nornir with NetBox and access NetBox data within your Nornir scripts or workflows. This integration enables you to utilise NetBox as a centralized source of truth for network data while taking advantage of Nornir’s capabilities for executing tasks or scripts against that data

Ansible and NetBox Modules

Nornir vs Ansible: Ease of Use and Learning Curve

Ansible vs Python for Network Automation

Python for Network Automation

Category: Python Network Automation
ansible course for network engineers
Get Access to my Ansible Course NOW
Previous Post:Ansible Templates
Next Post:Nautobot vs Netbox

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Sidebar

Hi I'm Roger Perkin,
Based in the UK working as a Network Automation Architect, CCIE #50038
About Roger | Twitter | Linkedin

python course for network engineers

More Python

  • Python Network Automation
  • Cisco pyATS Tutorial for Beginners
  • Network Automation Certification
  • Network Automation with Python
  • Python VENV / Virtual Environment Tutorial

Topics

Network Automation
Ansible
Python for Network Automation
CCIE
Cisco ISE
F5 Certification
BGP
OSPF
Network Automation Conferences
auvik promo banner
Pluralsight Trial

Git for Network Engineers

Ansible vs Nornir

Start learning today with my Network Automation Courses

Master Ansible, Python, Git, Nornir, Jenkins and more..


Buy me a coffeeBuy me a coffee

ansible network automation course

Have you seen my YouTube Channel?

YouTube Subscribe

Let’s get started

Take a look at my premium courses on Ansible, Nornir & Git or buy them all with the Network Automation Bundle!

Network Automation Courses

Navigation

Home

Blog

About

C

Python VENV Tutorial
Python for Network Engineers

Network Automation
Network Automation Courses
Network Discovery Tools
Network Automation Conferences
Ansible Training
Devops Tutorial
Network Source of Truth
DevOps Glossary
Network Monitoring Software

Contact

Contact

Get in touch with me here

[email protected]

  • Twitter
  • LinkedIn
  • YouTube
Buy me a coffeeBuy me a coffee

Copyright © 2025 · Roger Perkin · All Rights Reserved · Privacy Policy – Terms