mirror of
https://bitbucket.org/atlassian/dc-deployments-automation.git
synced 2025-12-13 16:33:08 -06:00
22 lines
485 B
Bash
Executable File
22 lines
485 B
Bash
Executable File
#!/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"}
|
|
LOG_FILE=${3:-"/dev/null"}
|
|
ENV_FILE=${4:-"/etc/atl"}
|
|
|
|
# Set the environment with default exports
|
|
set -a
|
|
source $ENV_FILE
|
|
set +a
|
|
|
|
# Use Ansible from virtualenv if provided
|
|
if [[ -f .venv/bin/ansible ]]; then
|
|
source .venv/bin/activate
|
|
fi
|
|
|
|
ansible-playbook -v -i $INV $PLAYBOOK | tee --append $LOG_FILE
|