Templates with Jinja2

In the previous section, we used variables with the Jinja2 syntax of {{ variable }}. While you can do a lot of complex things in Jinja2, luckily we only need some of the basic things to get started.

Jinja2 (http://jinja.pocoo.org/) is a full featured, powerful template engine for Python. It is widely used in Python web frameworks such as Django and Flask.

For now, it is enough to just keep in mind that Ansible utilize Jinja2 as the template engine. We will revisit the topics of Jinja2 filters, tests, and lookups as the situation calls for them. You can find more information on Ansible Jinja2 template here (http://docs.ansible.com/ansible/playbooks_templating.html).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.134.17