Chef - Executing commands in parallel - is it possible?


I use Chef to deploy and manage a vendor application. This application is installed multiple times (instances) per server for different business functions with only configuration files differing per instance.

Currently when I deploy / upgrade the solutions the chef runs complete in series but there are numerous executions that could occur is parallel.

Is it possible to execute two commands or include multiple recipes in parallel and then wait for both to finish before continuing next requirements?

Many thanks for reading and hope there is a solution …


I have never done this in chef but you could always take care of this with parallel. I did find this RFC that seems to be exactly what you are looking for:

In case I was not clear enough I meant using GNU parallel for commands: For normal ruby code I would guess that you could try using parallel in a ruby_block: It looks like in the future there might be something more native to chef when there is the resources available and appropriate demand hopefully the RFC will be implemented. I am actually very intrigued by this and come the new year will look at using parallel in a ruby_block as there is a lot that I have that could save some real time during convergence especially during initial.


Thanks for the response - It looks hopeful for a native Chef solution which would be great for me to use as it’ll reduce total deployment times drastically !!