Extracting estate-wide configurations
In this recipe, we'll make use of Ansible for JUNOS in order to have the configuration files from all of our routers copied back to the central Ansible control and management server. We'll define the hosts that we want managed, and how to authenticate with them, and we'll write a playbook—a series of activities that daisy-chain together—in order to orchestrate the activity.
Getting ready
In order to complete this recipe, you need a working Ansible environment, and you should have installed the PyEZ framework and related NETCONF client libraries in order to be able to communicate with the JUNOS nodes with NETCONF-over-SSH.
How to do it...
We're going to register our devices within the Ansible inventory file and then run a playbook that will capture the configuration files from them.
- Update the
hosts
file for the Ansible installation to include all of the JUNOS devices that you want managed. Remember to specify the connection=local directive in order to use...