We're going to create a new Ansible host inventory with a group to encapsulate all of our JUNOS OS devices. We'll define per-group variables for the JUNOS OS devices in a separate file and we'll encrypt that file by using an Ansible vault.
- First of all, create an Ansible hosts file to describe the estate of devices. Include with each host the IP address and the port number of the NETCONF-over-SSH service:
[JUNOS-devices] JUNOS1 ansible_host=10.0.201.201 ansible_port=830 JUNOS2 ansible_host=10.0.201.202 ansible_port=830 JUNOS3 ansible_host=10.0.201.203 ansible_port=830
- Create a subdirectory in the Ansible inventory directory—the directory that contains the host files—and name it group_vars.