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?

+3


source to share


3 answers


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 ).

+3


source


You can use saltutil.running function to check if there is a minion soloist work, fe

salt 'MINION' saltutil.running



See https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.saltutil.html#salt.modules.saltutil.running

0


source


With the 2017.7.0 salt, you can add a parallel=true

state to your command that will try to execute tasks in parallel.

0


source







All Articles