6

I don't think you will be able to get far without any plugins. What you can take a look at is the Default Values for 'Create Issue' screen plugin. We were using it in the past, however gave up because defaults could be set only per issue type, and no other conditions. I was in contact with the supplier, though, and they confirmed that defaults per user and ...


4

This templated SLS file works splendidly: {% if 'components' in salt.pillar.items() %} include: {% for component in salt.pillar.get('components').keys() %} - {{ component }} {% endfor %} {% endif %} However, it requires changing my pillar key structure. From the original question, you see the structure as: my-minion-id: ---------- components: ...


3

You can also do it like: {% if pillar['components'] is defined %} include: {% for component in pillar['components'] %} - {{ component }} {% endfor %} {% endif %} {% if pillar['components'] is defined %} components: require: {% for component in pillar['components'] %} - {{ component }} {% endfor %} {% endif %}


1

The syntax failures are caused by the presence of the {{...}} expression blocks (normally used for filling the template output with the corresponding content) inside the {%...%} statement blocks. I only used standalone jinja2 templates, so I'm not 100% certain if this applies to Ansible jinja templates as well, but I suspect so. In the Jinja2 {%...%} ...


Only top voted, non community-wiki answers of a minimum length are eligible