Ensure return code passes through output trimming
Ensure return code passes through output trimming

Currently the output of run-playbooks is filtered through an awk
statement to reduce the verbosity of the output. The problem is that
bash uses the return code from the right most command to determine the
return code for the whole pipe. Awk successfully processes the
run-playbooks output, even if run-playbooks fails, so awk returns 0, and
the pipeline is assumed to have completed successfully.

From the bash manual:

"Each command in a pipeline is executed in its own subshell (see Command
Execution Environment). The exit status of a pipeline is the exit status
of the last command in the pipeline, unless the pipefail option is
enabled (see The Set Builtin). If pipefail is enabled, the pipeline’s
return status is the value of the last (rightmost) command to exit with
a non-zero status, or zero if all commands exit successfully. If the
reserved word ‘!’ precedes the pipeline, the exit status is the logical
negation of the exit status as described above. The shell waits for all
commands in the pipeline to terminate before returning a value."

By enabling pipefail, we can ensure that the pipeline exits non-zero if
the run-playbooks script fails.

Closes-bug: #1432295
Change-Id: I019141a7bfbcfa817b90e39f4ae1a68eb3f269a5

metral/os-ansible-deployment,metral/os-ansible-deployment,manuelfelipe/openstack-ansible,cfarquhar/openstack-ansible,open-switch/infra_openstack-ansible,robb-romans/openstack-ansible,wenhuizhang/os-ansible-deployment,yanyao/openstack-deployment,stackforge/os-ansible-deployment,achekunov/openstack-ansible,VaneCloud/openstack-ansible,Logan2211/openstack-ansible,jpmontez/os-ansible-deployment,miguelgrinberg/os-ansible-deployment,d34dh0r53/os-ansible-deployment,jpmontez/openstack-ansible,antonym/openstack-ansible,BjoernT/os-ansible-deployment,openstack/openstack-ansible,yanyao/openstack-deployment,git-harry/os-ansible-deployment,sigmavirus24/openstack-ansible,bunchc/openstack-ansible,wenhuizhang/os-ansible-deployment,mrda/openstack-ansible,jpmontez/os-ansible-deployment,AlphaStaxLLC/os-ansible-deployment,AlphaStaxLLC/os-ansible-deployment,pombredanne/os-ansible-deployment,dhanunjaya/os-ansible-deployment,mrda/openstack-ansible,BjoernT/os-ansible-deployment,VaneCloud/openstack-ansible,sigmavirus24/os-ansible-deployment,major/openstack-ansible,major/openstack-ansible,git-harry/os-ansible-deployment,VaneCloud/openstack-ansible,yanyao/openstack-deployment,openstack/openstack-ansible,d34dh0r53/os-ansible-deployment,yanyao/openstack-deployment-liberty,robb-romans/openstack-ansible,dhanunjaya/os-ansible-deployment,sti-jans/openstack-ansible,major/os-ansible-deployment,weezer/openstack-ansible,sigmavirus24/os-ansible-deployment,mancdaz/openstack-ansible,jpmontez/os-ansible-deployment,open-switch/infra_openstack-ansible,mancdaz/openstack-ansible,manuelfelipe/openstack-ansible,jpmontez/openstack-ansible,sacharya/os-ansible-deployment,weezer/openstack-ansible,Logan2211/openstack-ansible,antonym/openstack-ansible,miguelgrinberg/os-ansible-deployment,yanyao/openstack-ansible,pombredanne/os-ansible-deployment,shane-c/openstack-ansible,achekunov/openstack-ansible,sacharya/os-ansible-deployment,bunchc/openstack-ansible,yanyao/openstack-deployment,BjoernT/openstack-ansible,AlphaStaxLLC/os-ansible-deployment,open-switch/infra_openstack-ansible,cfarquhar/openstack-ansible,sti-jans/openstack-ansible,BjoernT/os-ansible-deployment,antonym/openstack-ansible,pombredanne/os-ansible-deployment,shane-c/openstack-ansible,git-harry/os-ansible-deployment,mrda/openstack-ansible,stackforge/os-ansible-deployment,shane-c/openstack-ansible,yanyao/openstack-deployment-liberty,cloudnull/os-ansible-deployment,yanyao/newton,major/os-ansible-deployment,jpmontez/openstack-ansible,yanyao/openstack-ansible,yanyao/openstack-deployment-liberty,cloudnull/os-ansible-deployment,manuelfelipe/openstack-ansible,sti-jans/openstack-ansible,BjoernT/openstack-ansible,achekunov/openstack-ansible,os-cloud/os-ansible-deployment,sigmavirus24/openstack-ansible,os-cloud/os-ansible-deployment,yanyao/newton