Monday, March 9, 2020

Nornir vs. Ansible: what path to take?

Hello everyone

I'm somewhat lost in my endeavor to decide in what direction our networking automation should go..

A little bit of context; we're looking at a BGP EVPN VXLAN implemention in the near future, which we want to automation at least to some degree. The main focus is on VRFs, VNIs, BGP neighbors, interfaces and so on. But I suspect once we're there, it should be possible to abstract all of the configuration to YAML files and create a single source of truth. Although that is not the point right now. Probably an important point is, that we are at zero right now. Well, apart from some small scripts to collect information (with Netmiko and TextFSM) from other switches.

Where I'm at right now: I've played around with Nornir quite a bit lately. I do feel comfortable with it. I attached a link at the bottom with a sample of what I've done. If it's any good, I don't know..

I like the way I can handle all of it in Python and in conjunction with Jinja2 templates. I suspect there would be a bit of initial legwork but I can see a solution with it. On the other hand, I started to get comfortable with Ansible to really compare the solutions and ease the descision making process. And I have to tell you, I am not comfortable with Ansible right now. There seem to be very different approaches across the internet, and many of them I do not really like.

There are a lot of things I can't quite wrap my head around. For example, the directory structure I'm "supposed" to use. Do people create a role directory and then what? For example "spines"? And then a task directory where my YAML is at? Below I shamelessly linked a Github Repo with an example, it's not mine. Is this the way to go?

I'm not sure if I like the whole "I use a model ("nxos_ip_interface") where I can, if there is none, I just use "nxos_config" with config lines in the playbook (Jinja?) and if I absolutly have to, I'm gonna write my own module". Thats messy, isn't it?

Well, I don't really know, what to expect here. I guess I just want to have a discussion, some insight from others. In the end, I'm supposed to recommend a solution. For know I tend to go with Nornir, but to be very honest, I'm not even sure on my own and really struggling with finding arguments. Ansible is like Cisco in networking, nobody is going to hang you for going with it. That's in no way a justification to choose it, but it's one argument in the room...

Thanks in advance for any ideas, recommendations, links for educating myself and so on.

BGP Configuration Script (Nornir)

Some online example doing Ansible

PS: I'm don't usually post here, so if I broke any rules, please have some mercy...



No comments:

Post a Comment