Nornir vs Ansible: Which Automation Tool Is Better?

  Рет қаралды 8,074

CBT Nuggets

CBT Nuggets

Күн бұрын

Not a subscriber? Start your free week: cbt.gg/2I5NxY1
Read the full blog post here: cbt.gg/34yySj8
Ansible is one of the most popular automated configuration management tools, but it's not the only one out there. Nornir is an automation solution designed to provide concurrent task execution as well an abstraction layer for inventory management. Ultimately, Nornir is very similar to Ansible with one big distinction - Nornir is pure Python. What does this mean in real terms? Let's find out.
In this video, CBT Nuggets trainer John McGovern (‪@IPvZero‬) takes a look at Nornir and Ansible in terms of ease of use, ease to learn, support, and automation power. John also goes into YAML versus Python, and provides a few examples.
#Ansible #Nornir #Python

Пікірлер: 32
@frankiefuryland
@frankiefuryland 2 ай бұрын
As a fellow Scottish network engineer (Fae Glesga) it's good to hear you doing CBT nuggets and teaching others the massive benefits of network automation. Your vids on your channel have been so helpful, so thank you!
@MatheusAugustodaSilva
@MatheusAugustodaSilva 2 жыл бұрын
One theme that I often see in beginner-level network automation tutorials using Ansible is that the configuration scenarios are very simplistic: let's create some VLANs! let's configure static routing! let's enable OSPF! For these simple cases Ansible works just fine. The thing is, when facing real-world network automation scenarios you'll often have to adapt your automation to existing requirements, and this will involve a lot of nested if statement logic. In Ansible, anyone that has tried to implement multiple conditionals knows it is a chore. Data processing is a chore in ansible, as you need to explicitly register variables via a task and you can't just iterate over data structures like lists and dictionaries as easily as you'd want. Model-driven programmability can become a nightmare in Ansible. The more complex your automation becomes and the more requirements you put into the mix, the more control you need of what actually happens on the network. Ansible is simply not made to accomodate that amount of control. Even if you make your own Ansible modules with some custom Python code, you're just hacking around a tool that was never meant to do network automation in the first place; Ansible was built for system admins. Nornir, on the other hand, was built for network automation engineers.
@GtorT-ec6cc
@GtorT-ec6cc Жыл бұрын
Very well said.
@fraserb151
@fraserb151 3 жыл бұрын
Great content John, very useful. Keep posting these helpful videos 👍
@cruise2kx
@cruise2kx 3 жыл бұрын
Excellent video. I really liked the trivia behind the terms.
@network_girl8388
@network_girl8388 3 жыл бұрын
Thanks for the comparisons!
@IPvZero
@IPvZero 3 жыл бұрын
:)
@dcentvlog
@dcentvlog 2 жыл бұрын
Great explanation
@jairusan
@jairusan 3 жыл бұрын
Very useful comparison John, thank you very much, I still feel much inclined to continue learning python3 therefore, Nornir is the way I choose. Looking forward to continuing to learn with you. Until the next skill, Take care!
@IPvZero
@IPvZero 3 жыл бұрын
Thanks, Jair! Yup, I definitely agree. I think if you're interested in learning Python then Nornir is a great way to go. That said, I always make sure that I keep labbing Ansible since it's pretty much an essential in the current landscape and you're very likely gonna bump into it in the real world, either in production or answering exam questions :) Speak soon! -John
@jairusan
@jairusan 3 жыл бұрын
@@IPvZero great point! Thanks again, for all the great work you do.
@IPvZero
@IPvZero 3 жыл бұрын
@@jairusan Thanks Jair! :)
@Nikoolayy1
@Nikoolayy1 3 жыл бұрын
Ansible is also python :) If you want to write modules on Ansible you use Python.
@user-v2u-c2j
@user-v2u-c2j Жыл бұрын
^john thank you
@kabazulkifil158
@kabazulkifil158 3 жыл бұрын
Great video. Python is the way to go in network automation. We have to learn it.
@IPvZero
@IPvZero 3 жыл бұрын
Thanks Kaba! I definitely agree with you. Learning Python is a huge plus for network automation. Opens up so many possibilities!
@lilianacarmen7915
@lilianacarmen7915 3 жыл бұрын
Hi all! Is it possible to use Ansible modules with Nornir? Thanks!
@IPvZero
@IPvZero 3 жыл бұрын
Hey, Liliana. Ansible modules are tailored for that framework. However, the same type of logic you would write for an Ansible module - Python - is using natively within Nornir. So if you're comfortable with language you can just go straight to Nornir and write any Python logic you wish to achieve whatever task you want directly within the framework :) -John
@danielvalente2042
@danielvalente2042 3 жыл бұрын
Let me add a fourth reason to Ansible :), it is on the DevNet Associate content
@IPvZero
@IPvZero 3 жыл бұрын
Absolutely agree, Daniel! And on the DevNet Professional too! :) -John
@aspathprepend4477
@aspathprepend4477 2 жыл бұрын
Finally i can associate a face to the voice of the instructor that made me love nornir!!
@ParthPatel-jn6io
@ParthPatel-jn6io 3 жыл бұрын
Good comparison. But What about idempotency of nornir ? I knew ansible has idempotency nature.
@cbtnuggets
@cbtnuggets 3 жыл бұрын
Thanks for your question, Parth! Nornir in some of the early iterations, wasn't idempotency, but more things were introduced like Napalm and IP Fabric. The IP Fabric can be used for the network discovery and inventory and the rest can apply the configurations. We've heard of other ways of making this work and frankly, more and more plugins/improvements are being made to Nornir. This will largely also depend on how you write your scripts. We hope this is helpful for you, thank you for learning with us!
@randyrozo
@randyrozo 2 жыл бұрын
The best
@ganesh634
@ganesh634 3 жыл бұрын
Ansible is a tool that is written in Python and easily extensible by writing custom Ansible plugins which are basically Python files. Writing reusable custom Ansible plugins can avoid complex playbooks and abstract the code implementation from users.
@IPvZero
@IPvZero 3 жыл бұрын
Hey Ganesh, I agree. You can certainly write your own Ansible modules and this is certainly fine to do here and there, if you have the Python skills to do so. However, if you're having to resort to writing Python code to get around the barriers you're running into using Ansible, then in my opinion, you're probably going to be better served just using Nornir and enjoying the full flexibility and performance that it offers :)
@ganesh634
@ganesh634 3 жыл бұрын
IPvZero The point I wanted to make is you can learn python by using Ansible as well. I would say writing Ansible plugins is a smart way to solve problems by taming the tool :). While Ansible ecosystem can be tuned to achieve greater performance the main strength lies in ease of usability and maintainability as after automation is done most likely a person won't be sitting in front of system watching daily automation task run. I have used ssh based libraries in past for writing custom automation scripts but in my experience in the long run the maintenance overhead results in diminishing returns. Having said all of the above the best approach would be to understand the capabilities of available tools and pick the one that best fits a given environment :)
@IPvZero
@IPvZero 3 жыл бұрын
@@ganesh634 I definitely agree. Ultimately my position is both are very useful tools, and neither makes the other obsolete. As you say, pick the tool that's best for your environment! :)
@afara2000
@afara2000 2 жыл бұрын
@@IPvZero Hi, Does Nornir have vault feature like Ansible to encrypt variables such as usernames/password/etc? If not, can it be integrated with Ansible Vault? Thanks.
@IPvZero
@IPvZero 2 жыл бұрын
@@afara2000 You can use Ansible vault with Nornir, as best I am aware. Probably the best solution would be using Hashicorp Vault, though! :)
@chiyupao5497
@chiyupao5497 3 жыл бұрын
我全都要
Introduction to Nornir | Python Network Automation!
19:45
IPvZero
Рет қаралды 14 М.
Do NOT Learn Kubernetes Without Knowing These Concepts...
13:01
Travis Media
Рет қаралды 262 М.
Идеально повторил? Хотите вторую часть?
00:13
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 12 МЛН
Это реально работает?!
00:33
БРУНО
Рет қаралды 4 МЛН
Top 5 Recession-Proof IT Certs under $401
7:30
CBT Nuggets
Рет қаралды 4,9 М.
What is the OSI Model and is it Still Relevant?
9:30
CBT Nuggets
Рет қаралды 31 М.
Top 5 Python Libraries for Network Automation
7:03
CBT Nuggets
Рет қаралды 17 М.
Stop, Intel’s Already Dead! - AMD Ryzen 9600X & 9700X Review
13:47
Linus Tech Tips
Рет қаралды 1 МЛН
Automate your network with Nornir - Python automation framework
48:23
Which CCNP Enterprise Specialty Exam Should You Take?
7:19
CBT Nuggets
Рет қаралды 33 М.
get started with Ansible Network Automation (FREE cisco router lab)
15:02
Getting Started with SD-WAN | A Hands-On Overview
6:46
CBT Nuggets
Рет қаралды 84 М.