Is there a simple way to count the number of minions returned by a match, for example:
salt -C 'G@ec2_roles:test' match.count
You can add --summary
to any salt call like:
salt -C 'G@ec2_roles:test' --summary
The you will get an report at the end of the execution which tells you how many minions were targeted:
-------------------------------------------
Summary
-------------------------------------------
# of minions targeted: 528
# of minions returned: 501
# of minions that did not return: 27
# of minions with errors: 0
-------------------------------------------
You could change the output format and run it through wc:
salt -C 'G@ec2_roles:test' test.ping --out=txt | wc -l