diff --git a/bin/cdist-mass-deploy b/bin/cdist-mass-deploy index 84e4376d..f5790c03 100755 --- a/bin/cdist-mass-deploy +++ b/bin/cdist-mass-deploy @@ -22,10 +22,25 @@ # . cdist-config -[ $# -ge 1 ] || __cdist_usage " [target host ...]" +[ $# -ge 1 ] || __cdist_usage "[-p] [target host ...]" set -eu +if [ "$1" = "-p" ]; then + parallel=yes +else + parallel="" +fi + while [ $# -ge 1 ]; do - cdist-deploy-to "$1" + if [ "$parallel" ]; then + cdist-deploy-to "$1" & + else + cdist-deploy-to "$1" + fi shift done + +if [ "$parallel" ]; then + echo "Waiting for cdist-deploy-to jobs to finish..." + wait +fi