Performing platform-specific or group-specific operations
In this recipe, we'll build on the experiences of previous recipes by using Ansible to deploy to configurations to a restricted set of devices without our estate, perhaps based upon either hardware type or software type. We'll explore adding variables to our inventory record which can influence playbooks, and we'll also look at dynamically determining playbook execution.
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 update our inventory list to add a custom variable to each host record which defines its hardware type, and then we're going to run a playbook that selectively adds some firewall configuration, based on the value of this variable.
- Modify our inventory file in order to collect together all of...