Trim ansible's output to console.log

Since I2786f73334b99bfa98d344c50337c86f75fae273 ansible's output is
logged properly to a file and published at the end of a gate check.
This trims the output from ansible to the console to make the console
log that is published far shorter and easier to read.

Co-Authored-By: Ian Cordasco <ian.cordasco@rackspace.com>
Change-Id: I98fb57a56c1b7ddd6558e265cf6e65b159a05123
Partial-bug: 1425482
This commit is contained in:
David Wilde 2015-03-06 17:34:35 -06:00 committed by Ian Cordasco
parent 6f38cd4754
commit a9244537d6

View File

@ -73,7 +73,18 @@ set +x && get_instance_info && set -x
# Run the ansible playbooks if required
if [ "${RUN_PLAYBOOKS}" == "yes" ]; then
source $(dirname ${0})/run-playbooks.sh
# Set-up our tiny awk script.
strip_debug="
!/(^[ 0-9|:.-]+<[0-9.]|localhost+>)|Extracting/ {
gsub(/{.*/, \"\");
gsub(/\\n.*/, \"\");
gsub(/\=\>.*/, \"\");
print
}
"
source $(dirname ${0})/run-playbooks.sh > ansible-logs.tmp
awk "${strip_debug}" < ansible-logs.tmp
rm -f ansible-logs.tmp
fi
# Run the tempest tests if required