Targeting salt minions using multiple grains

In our infrastructure, we install many grains in the minion, including the medium and component grains. Based on this, there may be several minions with the same component name, each in a different environment. I want to be able to select minions based on multiple grains instead of defining multiple node groups on the main server.

I tried:

salt -G 'component:api,environment:prod' test.ping

It does not seem to work, I looked at their documentation in quite some detail and did not find any examples of targeting this type of minion.

Is this possible, and if so, how can I do this?

+4
source share
1 answer

, , , , .

salt -C 'G@environment:prod and G@component:accounts' test.ping

: http://docs.saltstack.com/en/latest/topics/targeting/compound.html

+1

All Articles