DCD-224: Add wrapper script to import environment vars from file.

This commit is contained in:
Steve Smith
2019-04-01 14:48:06 +11:00
parent 8be5245cc0
commit 84cb4ec9ae

16
bin/ansible-with-atl-env Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
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"}
# Set the environment with default exports
set -a
source $ENV_FILE
set +a
ansible-playbook -v -i $INV $PLAYBOOK