If you Google “Ansible” and “Junos” you’ll find literally hundreds of articles, posts and videos… some covering pre 2.0 Ansible, some covering Ansible 2.5, or 2.6 or later and almost all of them are completely different – and a great many of the instructions no longer work!
I recently wanted to test out the Ansible Junos modules put out by Juniper but first I had to spend a good hour figuring out all the inter dependencies to get everything working on a CentOS 7 server. The Juniper DAY ONE: AUTOMATING JUNOS WITH ANSIBLE written by Sean Sawtell is a great starting point but I ran into problems just getting my local environment running. The hundreds if not thousands of posts and videos were extremely confusing and I quickly grew frustrated.
What follows is a quick guide on how to get everything working on a minimal CentOS 7 server. Depending on your requirements, it might be more advisable to look at running a fully prepared Docker container, where all the needed software is ready to run. You just need to provide the Ansible configuration and playbooks.
Here’s what you need to-do from root or a root equivalent account using sudo. Since I built this test VM on a VMware ESXi 6.5 server I wanted to install the open-source VMware tools and perform any updates.
yum install open-vm-tools
yum update
init 6
yum install epel-release
yum install python3 jxmlease
pip3 install ncclient
pip3 install junos-eznc
pip3 install ansible
ansible-galaxy install Juniper.junos
That’s all you need and you are ready to go… if you want to play around with Netmiko or Napalm you only need to use PIP to install those Python modules.
pip3 install netmiko pip3 install napalm
Cheers!
Ben says
Michael I appreciate you dedication and support w/ networking. I’ve came across a lot of good information from you.
This comment is unrelated to this post, but it may be the best way to in touch w/ you. Everyone I apologize for the random question and I hope you can help w/ it.
It’s related to MSTP, what’s best practice for uplink config for the ERS 5500 series? Specifically, bpdu-filtering. I see your recommendation for the edge ports, but is it recommended to put it on the uplinks.
Sorry for the random question and thanks for the help.
Michael McNamara says
Hi Ben,
If you are running an Extreme’s (formerly Avaya’s) IST/SMLT architecture you’ll need to keep Spanning Tree to just the local switch. If you are running a simple flat network with no IST/SMLT then you can run MSTP just like you can run STP/RSTP across the entire network on all your uplinks, downlinks and edge ports.
Cheers!