Saltstack: run parallel / wait for other jobs
I have a few salt states and commands that are executed when other jobs are currently running.
Then I get an error for new jobs like:
Function "state.apply" works like PID 3869 and was launched in 2017, 23 March 10: 19: 32.691177 with jid 20170323101932691177
Is there a way to wait for other jobs to complete, or to run the job in parallel?
source to share
You can pause the execution of the salt states:
salt minion_A state.apply some.state queue=True
This will queue up if any other states are currently running, remember that this option starts a new thread for each run in the queue in the queue, so use this setting sparingly ( https://docs.saltstack.com/en /latest/ref/modules/all/salt.modules.state.html ).
source to share
With the 2017.7.0 salt, you can add a parallel=true
state to your command that will try to execute tasks in parallel.
source to share