In our infrastructure, we set multiples grains on the minion including an "environment" and "app" grain. When we use the cli, we can get the correct minions using:
salt -C "G@app:middle_tier_1 and G@environment:dev" test.ping
But if we try to use the cherrypy api, only got a result if set only one target like:
[{"client":"local","tgt_type":"grain","fun":"test.ping","tgt":"G@app:middle_tier_1"}]
or
[{"client":"local","tgt_type":"grain","fun":"test.ping","tgt":"G@environment:dev"}]
with multiples one, don't get any
[{"client":"local","tgt_type":"grain","fun":"test.ping","tgt":"G@app:middle_tier_1 and G@environment:dev"}]
[{"client":"local","tgt_type":"grain","fun":"test.ping","tgt":["G@app:middle_tier_1","G@environment:dev"]}]
According with the documentation, i can use a list in the tgt paramenter.
I have looked their documentation fairly extensively and have found no examples of this type of minion targeting. Is this even possible, and if so, how would I go about doing it?
Extra info: salt-master 2018.3.2 (Oxygen) salt-api 2018.3.2 (Oxygen)
Thanks in advance!