972aa56581
Puppet apply is single threaded and slow. We are testing many puppet applies in noop mode so it should be safe to run them in parallel using the number of cpus available to us. Make it so. Change-Id: I66250d21258de7791e4f5fc0b013100efae63603
15 lines
534 B
Bash
Executable File
15 lines
534 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
ROOT=$(readlink -fn $(dirname $0))
|
|
MODULE_PATH="${ROOT}/modules:/etc/puppet/modules"
|
|
|
|
if [ ! -d applytest ] ; then
|
|
mkdir applytest
|
|
fi
|
|
|
|
csplit -sf applytest/puppetapplytest manifests/site.pp '/^$/' {*}
|
|
sed -i -e 's/^[^[:space:]]/#&/g' applytest/puppetapplytest*
|
|
sed -i -e 's@hiera(.\([^.]*\).,\([^)]*\))@\2@' applytest/puppetapplytest*
|
|
|
|
find applytest -name 'puppetapplytest*' -print0 | xargs -0 -P $(nproc) -n 1 -I filearg sudo puppet apply --modulepath=${MODULE_PATH} --noop --verbose --debug filearg > /dev/null
|