I would like to add some generic pillar data to minions based on roles, but also offer a way to customize each machine based on hostname (minion id).
In my pillar/top.sls file I have
base:
'*':
- pkgs/common-ubuntu-pkg
- fail2ban/config
'runit:True':
- runit/package
'is_virtual:True':
- users/vmuser
'role:database':
- match: grain
- mysql/defaults
And then I want to add something like this:
{% for host in pillar %}
'{{host}}':
include:
- {{host}}/passwords
{% endfor %}
Which works, but it only prints out 'master'. I'm using master-less salt-ssh, so I believe that's why the minions in the roster are not already in the pillar. I would like a different way to loop over defined minions, but I can't seem to easily get a view of what is in the salt dictionary.
{% for key in salt %}
'{{key}}':
include:
- foobar
{% endfor %}
Trying to debug using something like the above results in a KeyError