Junos Automation (Scripting)
Junos Automation (Scripting)

Junos Automation with Ansible

‎05-28-2018 01:00 PM

Hello Experts,


I am new to the concept of using Ansible for Junos automation. I have a couple of queries about this topic.

I have a few Juniper devices(Switches and Firewalls) running in the production network. I have installed a test Ansbile server and played around with it for a while.


For taking this to the production, how do I start? For example, if  I have 10 devices, do I have to write 10 different YAML files to manage each device?


Also I understand that I can run 'juniper_junos_config' module and get the current config and then convert it to a YAML file and save it.

But how do I do the actual config changes with 'juniper_junos_config'? Do I have to keep the junos config in a separate file and then call that file into the YAML play-book OR do I have to write the junos set command with the the YAML itself? What is the most preferred way?

Junos Automation (Scripting)

Re: Junos Automation with Ansible

‎05-29-2018 03:18 AM

Have you seen this guide?




I would start by deploying ssh keys and setting up regular backups of your configurations using Ansible.


From there, look for real world for your network cases where you need to make regular changes, config verifications or monitoring tasks.  Then automate those specific functions.


Steve Puluka BSEET - Juniper Ambassador
IP Architect - DQE Communications Pittsburgh, PA (Metro Ethernet & ISP)