Search code examples
salt-project

How can multiple results be returned for salt minions


I would like to know both a pillar value and the result of a command for all my minions. Is there anyway to combine the result in one call?

I'm looking for something that would work like this

$ salt '*' cmd.run 'systemctl status <process>' pillar.get 'name'

Is something like that possible with the salt command? This answer mentions the survey.hash runner, that allows aggregating the results by output, but that is the closest I can find.


Solution

  • You could do something like this:

    $ salt '*' cmd.run 'systemctl status <process>; salt-call pillar.get "name"'

    Salt-call runs locally on the minion, therefore returning only the pillars belonging to that Minion.