loops in jinja2 code example
Example 1: jinja if
{% if 'priority' in data %}
<p>Priority: {{ data['priority'] }}</p>
{% endif %}
Example 2: nesting in Jinja2 expressions
{% for host in groups[dc ~ '-linux'] %}
{% if 'priority' in data %}
<p>Priority: {{ data['priority'] }}</p>
{% endif %}
{% for host in groups[dc ~ '-linux'] %}