Michael McNamara https://blog.michaelfmcnamara.com technology, networking, virtualization and IP telephony Fri, 03 Jul 2020 12:01:48 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.3 How to install and setup Ansible to manage Junos on CentOS https://blog.michaelfmcnamara.com/2020/07/how-to-install-and-setup-ansible-to-manage-junos-on-centos/ https://blog.michaelfmcnamara.com/2020/07/how-to-install-and-setup-ansible-to-manage-junos-on-centos/#comments Fri, 03 Jul 2020 12:01:48 +0000 https://blog.michaelfmcnamara.com/?p=6563

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!

]]>
https://blog.michaelfmcnamara.com/2020/07/how-to-install-and-setup-ansible-to-manage-junos-on-centos/feed/ 2