计算匹配的盐族奴隶的数量

有一个简单的方法来计算比赛返回的小分队的数量,例如:

salt -C 'G@ec2_roles:test' match.count 

你可以添加 – --summary任何盐的电话,如:

 salt -C 'G@ec2_roles:test' --summary 

在执行结束时,你会得到一个报告,告诉你有多less个目标:

 ------------------------------------------- Summary ------------------------------------------- # of minions targeted: 528 # of minions returned: 501 # of minions that did not return: 27 # of minions with errors: 0 ------------------------------------------- 

您可以更改输出格式并通过wc运行它:

 salt -C 'G@ec2_roles:test' test.ping --out=txt | wc -l