Last active
January 20, 2016 05:08
-
-
Save cybacolt/b1bd98534c155ee582a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) make sure mine_interval is set in your minion config | |
2) add mine functions to your minions pillars: | |
mine_functions: | |
grains.items: [] | |
3) wait until this returns data on your salt master: | |
salt '*' mine.get '*' grains.items | |
4) mine data from minions is now available in states like this: | |
salt['mine.get']('myminion*', 'grains.items') | |
5) mine data from minions is now available in pillars like this: | |
salt['saltutil.runner']('mine.get', tgt='myminion*', fun='grains.items', tgt_type='compound') | |
6) if there are multiple minions returned, you'll need to do a for loop over it: | |
{% for host, grains in salt['mine.get']('myminion*', 'grains.items').items() %} | |
7) if you have a minion than requires alot of mine data, and you start to have timeout problems when you run state.highstate, this was my work around: | |
https://github.com/saltstack/salt/issues/21403#issuecomment-172723015 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment