I'm trying to create a dummy state in Salt to pull dependencies from a list derived from a pillar.
In my top.sls file, I have:
base: '*': - components Then, in components.sls, I have:
{% if 'components' in pillar.items() %} include: {% for component in pillar.get('components',[]) %} - {{ component }} {% endfor %} {% endif %} {% if 'components' in pillar.items() %} components: require: {% for component in pillar.get('components',[]) %} - {{ component }} {% endfor %} {% endif %} When I check the pillar contents, I see:
$ salt my-minion-id pillar.items my-minion-id: ---------- components: - a-dependency-name But when I try to see the set of states, I see:
$ salt my-minion-id state.show_sls components my-minion-id: ---------- ...and that's it.
My ultimate goal, here, is to treat the minion as hostile, so I'm trying to pull role details out of pillars instead of assigning roles in my file_root's top.sls. It's my understanding that every minion has full access to the contents of the file_root, and I don't want a hostile minion to know the specific firewall or services of any unrelated node.
Edit:
I discovered that my pillar structure didn't support pillar merging, as it used lists, so I switched to a pillar-structure that used no-value dicts:
my-minion-id: ---------- components: ---------- a-dependency-name: None