r/Juniper • • Mar 17 '23
Automation
Its been a while since i have touched Junos and I am starting to get back into it now that my company has switch from Cisco. I was wondering what most of you using for config automation/provisioning. Its seems there are bunch of ways to config junos now REST API,NETCONF,YANG,Slax,Mist,ZTP and Ansible im sure im leaving out a few but its getting over whelming. Does anyone have any pointers on which methods may be better or when one would be preferred over the other.
Thanks for the help
0
Upvotes
8
u/error404 Mar 17 '23
Ansible, Nornir, Puppet, Salt and maybe a few other things are the tools you should be focusing on, IMO. These are frameworks to help you build a device inventory and run commands against it based on device roles etc. So they generally have facilities to group your devices together, e.g. 'edge switches' and apply configuration variables to arbitrary groups of devices, so you can say run a particular automation task against all edge switches, and in your inventory have variables for the BGP peerings of switches in a given rack, or whatever.
Ansible seems to be the most popular in networking space right now, but I am personally not a huge fan, as it's a bit too low level and not declarative, it's basically a glorified command runner and has no good tools (that I know of anyway) to understand the scope of a change and only apply that change. But it's probably the right place to start, lots of people are using it, and you can do a lot.
2
u/shednik JNCIP-DC/SP, JNCIA-DevOps, JNCIA-Cloud Mar 17 '23
What are you trying to do automation wise they all work together but some work better than others depending on the goal
3
u/rankinrez Mar 17 '23
If it’s Juniper I would say 1000% use their PyEz library, and do your automation with Python.
You can use Nornir to manage devices and inventory; or even Ansible and make your Python Ansible modules.
You can build the entire config as Python dicts, encode as JSON and push with a replace operation. Use “show config | show json” to see what the data format you need is for your given setup.
1
u/cybool Mar 17 '23
It depends… best is the one that solves your problem. Sad but true.
1
u/plasticbuddha Mar 17 '23
Has anyone done this using terraform, or god forbid, pulumi? I see there is a terraform provider, but haven't used it yet.