In this recipe, we will outline how to validate input data using Ansible. We rely heavily on the information that we either retrieve from the network or declare in host or group variables, in order to execute different tasks in Ansible such as generating configuration or provisioning devices. Before we start to use this information, we need to be able to validate the structure and validity of this data before further processing our playbooks.
- Create an ACLs definition in ACLs.yml, as shown in the following code block:
- src: 10.1.1.0/24
- src: 10.2.1.0/24