From 1a0cee7aabd18eb847632434bb99508d5548f2fd Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Mon, 8 Apr 2019 10:26:12 +1000 Subject: [PATCH] DCD-224: Add optional logging of playbook output. --- bin/ansible-with-atl-env | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/ansible-with-atl-env b/bin/ansible-with-atl-env index 99060ff..0da9640 100755 --- a/bin/ansible-with-atl-env +++ b/bin/ansible-with-atl-env @@ -5,11 +5,12 @@ set -e # Optionally take an environment file on the command-line for testing. INV=${1:?"Inventory file must be specified"} PLAYBOOK=${2:?"Playbook must be specified"} -ENV_FILE=${3:-"/etc/atl"} +LOG_FILE=${3:-"/dev/null"} +ENV_FILE=${4:-"/etc/atl"} # Set the environment with default exports set -a source $ENV_FILE set +a -ansible-playbook -v -i $INV $PLAYBOOK +ansible-playbook -v -i $INV $PLAYBOOK | tee --append $LOG_FILE