O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

All of the JUNOS OS devices are placed within the hosts inventory file in a group called JUNOS-devices, using the INI-file style [group] syntax. This allows us to refer to the collective, rather than individual hosts, when we go to define actions and tasks.

Then we create a playbook, which is a set of task definitions. In our case, we have used one playbook that consists of two tasks, executed in sequence:

  1. JUNOS_facts: The module to extract basic platform and inventory information, including configuration.
  2. copy: An Ansible core module used to manipulate files.

The playbook defines the scope of the activities as JUNOS-devices. This could be a single host, a host group or a host pattern, but in our case it's a reference to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required