As a `chef-run` operator,
I would like to be able to control the concurrency of my `chef-run`s,
So that I can better orchestrate my adhoc tasks ..
For example, let’s assume I have defined a range of hosts (`tomcat-prod[1:10]`) I want `chef-run` against to patch Java and restart Tomcat .. My recipe looks something like this:
package 'java-1.8.0-openjdk-devel' do
notifies :restart, 'service[tomcat]', :delayed
service 'tomcat' do
The problem I am having is that they will all upgrade and restart at the same time, which means downtime .. I would like to have the opportunity to use a `--concurrency` option that would limit how many hosts are being worked on at the same time << very similar to the `knife ssh` option .. If possible, I would like to also be able to define a percentage value that would calculate how many hosts exists, and then based on my percentage value, work on the allowed amount ..
Example commands are:
# ASSUME 10 hosts total
# only work on 5 nodes at a time
chef-run tomcat-prod[1:10] upgrade_and_restart.rb --concurrency 5 ..
# only work on 50% of nodes at a time (i.e. 5 in in this example)
chef-run tomcat-prod[1:10] upgrade_and_restart.rb --concurrency '50%' ..
Before you say: “Greg, you already know there are 10 hosts, so just define 5 and be done with it” .. This is true, BUT, I have another idea submitted were we allow hosts pattern matching using regex, and if that comes true, then the `chef-run` operator may not know how many hosts exist and so we should allow them to deal in percentages vs hard numbers ..
Thanks and let me know if you have questions .. Here is a link to how Ansible is doing it using `serial` :: https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html#rolling-update-batch-size