How can I test jinja2 templates in ansible?
问题 Sometimes I need to test some jinja2 templates that I use in my ansible roles. What is the simplest way for doing this? For example, I have a template (test.j2): {% if users is defined and users %} {% for user in users %}{{ user }} {% endfor %} {% endif %} and vars (in group_vars/all): --- users: - Mike - Smith - Klara - Alex 回答1: At this time exists 4 different variants: 1_Online (using https://cryptic-cliffs-32040.herokuapp.com/) Based on jinja2-live-parser code. 2_Interactive (using python