thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Intermediate

Jinja2

A Python templating engine used by Ansible, Salt, and network automation scripts to generate configurations from variables.

Definition

Jinja2 uses {{ variable }} for expressions, {% for %} and {% if %} for control structures, and filters such as | default and | upper. Ansible's template module renders .j2 files.

Example

{% for vlan in vlans %}vlan {{ vlan.id }} name {{ vlan.name }} {% endfor %}

Exam tip

Recognize {{ }} for variables and {% %} for logic.

Related terms