1

Using salt on the command line, how can I get multiple grains from remote systems?

For example, I can get os and osrelease individually:

salt '*' grains.get os
salt '*' grains.get osrelease

But I really want to get them both simultaneously, so I don't have to write a parsing script (or something) to first collect all the answers from os, and match them up with the answers from osrelease...

I want something like this, which would get both grains at once:

salt '*' grains.get os,osrelease    (this doesn't work)
OrangeDog
  • 36,653
  • 12
  • 122
  • 207
Edward Ned Harvey
  • 6,525
  • 5
  • 36
  • 45

1 Answers1

4

Use grains.item instead.

salt '*' grains.item os osrelease
blhsing
  • 91,368
  • 6
  • 71
  • 106