-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi David,
You can set a special pillar-key "mine_functions" to list the functions a minion should run to populate the salt mine. But you can't access pillar before rendering pillar is done (and I think this limitation still applies with an external pillar). So you'd have to add both role and mine_functions in one go. If you don't want to list all the mine functions for every minion you can use a templated include in your pillar passing the minion's roles to the template which decides what to put into mine_functions based on the role(s).
Also don't forget Pillar data is cached on the minions. So you want to run `saltutils.pillar_refresh` and then `mine.update` on all minions before trying to populate your file (although both functions get run on minion start-up).
Then you could just use s/t like
{% for server, addrs in salt['mine.get']('role:server', 'network.ip_addrs', expr_form='pillar').items() %}
{{ server }} {{ addrs[0] }}
{% endfor %}
Regards, Florian
>--
>You received this message because you are subscribed to the Google
>Groups "Salt-users" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to
salt-users+...@googlegroups.com.
>For more options, visit
https://groups.google.com/d/optout.
-----BEGIN PGP SIGNATURE-----
Version: APG v1.1.1
iQFTBAEBCAA9BQJVF7i9NhxGbG9yaWFuIEVybWlzY2ggPGZsb3JpYW4uZXJtaXNj
aEBhbHVtbmkudHUtYmVybGluLmRlPgAKCRAu8tzCHoBI/ei5B/9iHr/6/2YyPssV
B5pBup92fWJuF7cF8BtE1cLkGKBy6ZHVuKrvTUbdtf9Ok+qpv2putdIBwLdVYOFT
WGEZrYH7JcSE7LKzZ4r+A0JhboptARR0NWoRaMBB714tomDRXi1gKZnaMzBxFGY8
NkGTt+hP1y8n93Ci+Y4NHSYVImfs741frHlGuGAMOZtwiD1cihbAnpshx6TXGZQV
XS5a6sN48+lU63HFziNDAxLZ2s8vfCwQuJVN2+8lVLPblDhJSKdSyg3Rj0LViLem
ADIoDRnhFRp5xmX3dNoyqWeDfn25RaXbNKBjHcsXk0PnxgnYDjHDscFTmDvC8y3/
9kOOnpaP
=JV5y
-----END PGP SIGNATURE-----