1 # 常规的定义方式
2 nodegroups:
3 group1: L@host1,host2,host3
4
5 # YAML 定义方式
6 nodegroups:
7 group1:
8 - host1
9 - host2
10 - host3
1 # The 「-b」 (or 「--batch-size」) option allows commands to be executed on only a specified number of minions at a time.
2 # 同一时间执行多少 minion,支持百分比和数字。
3 salt '*' -b 10 test.ping # 同一时间执行 10 台,完毕后执行另外 10 台,依次执行下去
4 salt '*' -b 80% test.ping # 同一时间执行 80% 的minion 端,完毕后执行另外 80%【实际是最后的 20%】。
5 salt -G 'os:RedHat' --batch-size 25% apache.signal restart #
6
7 # --batch-wait minion返回后,等待多少秒在发送命令给新的minion
8 salt '*' -b 25% --batch-wait 5 test.ping # 第一批minion反馈后,等待 5 秒后,在发送命令给下一批的minion。