我想安排一个highstate运行,每天晚上但不平行。 有没有办法将batch选项添加到调度系统?
例:
schedule: highstate: enabled: True function: state.highstate maxrunning: 1 when: 3:00am kwargs: batch: 1
理想情况下,我也想随机的时间运行。 我想我可以安排在一个小时的时间范围内每两小时运行一次,所以它只能运行一次:
schedule: highstate: enabled: True function: state.highstate maxrunning: 1 range: start: 3:00am end: 4:00am hours: 2 kwargs: batch: 1
从主设备启动高状态时,可以使用称为批处理模式的function。
--batch-size标志允许你指定并行运行多less--batch-size 。 你可以使用下面的命令:
salt --batch-size 1 '*' state.highstate
关于运行时间,可以使用如下的splay参数:
splay: start: 10 end: 15
这将显示10到15秒之间的时间
如果你想使用它与一个调度系统:
编辑/etc/anacrontab并添加RANDOM DELAY和START_HOURS_RANGE参数:
# The maximal random delay added to the base delay of the jobs RANDOM_DELAY=60 # interval, when scheduled jobs can be run, in hours START_HOURS_RANGE=3-4
1 10 update.daily /usr/bin/salt --batch-size 1 '*' state.highstate