Jinja2 is a powerful templating engine for Python and is supported by Ansible. It is also used to generate any text-based files, such as HTML, CSV, or YAML. We can utilize Jinja2 with Ansible variables in order to generate custom configuration files for network devices. In this recipe, we will outline how to use Jinja2 templates with Ansible.
Using Jinja2 with Ansible
Getting ready
In order to follow along with this recipe, an Ansible inventory file must be present and configured as outlined in the previous recipes.
How to do it...
- Create a new file inside the group_vars...