Basically I am creating a Salt state describing Munin server configuration and I need to get a list of all minions known to the master, something like this:
Why not use minion.list module?
In our pillar environment we have pillar that are private to each minion (/srv/pillar/hosts/[server_A, server_B, server_C...]/some_pillar.sls).
To make things easier (since some people keep forgetting to add new pillars to the top file) our pillar top file looks like this:
{{ saltenv }}:
{% for minion in salt['minion.list']()['minions'] -%}
{{ minion + '*' }}:
- hosts.{{ minion.split('.')[0] }}
{% endfor -%}
This way I can get a list of all minions known to the master every time the pillar enviorment is updated.