Hi,
Saltstack newbie, at my wit's end.
Trying to set variables in map.jinja based on values received from pillar data:
map.jinja:
{% set vars = {
{% if salt['pillar.get']('ec2:tags:application') == 'jboss' %}
'admingroup': 'jbossadmins'
{% end if %}
}
%}
Then call this from a state file
...
{% set admin = vars.admingroup %}
And I will use {{ admin }} where I need to.
This produces an error with:
Rendering SLS failed: Jinja syntax error: unexpected '%'
{% if salt['pillar.get']('ec2:tags:application') == 'jboss' %} <======================
I could not figure out what is wrong.
What is the recommended approach for setting variables based on values obtained from pillars?
Thank you.