From 15a217c5e491f43536cf18df80a9c08463268d74 Mon Sep 17 00:00:00 2001 From: K Jonathan Harker Date: Tue, 3 Jun 2014 17:28:27 -0700 Subject: [PATCH] Move variables in manifests/site.pp to top of file Put the variables defined in manifests/site.pp at the top of the file so that they are in a known location after running csplit in test.sh and we can prepend them to the puppet-apply top files. A better solution would be to move this data into hiera, but this is not sensitive data, so a move to hiera should wait until we a have solution for a public hiera data repo separate from the private hiera data. Change-Id: I509a8266462dfdf53e1727938e4fb043241166b6 --- test.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test.sh b/test.sh index 1bc035bd8a..dc8ebe3e4b 100755 --- a/test.sh +++ b/test.sh @@ -8,7 +8,14 @@ if [ ! -d applytest ] ; then fi csplit -sf applytest/puppetapplytest manifests/site.pp '/^$/' {*} -sed -i -e 's/^[^[:space:]]/#&/g' applytest/puppetapplytest* +sed -i -e 's/^[^][:space:]$]/#&/g' applytest/puppetapplytest* sed -i -e 's@hiera(.\([^.]*\).,\([^)]*\))@\2@' applytest/puppetapplytest* +mv applytest/*00 applytest/head # These are the top-level variables defined in site.pp -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 +for f in `find applytest -name 'puppetapplytest*' -print` ; do + cat applytest/head $f > $f.final +done + +find applytest -name 'puppetapplytest*.final' -print0 | \ + xargs -0 -P $(nproc) -n 1 -I filearg \ + sudo puppet apply --modulepath=${MODULE_PATH} --noop --verbose --debug filearg > /dev/null