enhance cdist-mass-deploy and add parallel execution

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-04-06 14:05:47 +02:00
parent 86a6b10ae9
commit b9ef12b48d
1 changed files with 17 additions and 2 deletions

View File

@ -22,10 +22,25 @@
#
. cdist-config
[ $# -ge 1 ] || __cdist_usage "<target host> [target host ...]"
[ $# -ge 1 ] || __cdist_usage "[-p] <target host> [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