infra/ansible/run.sh
2025-05-30 13:24:38 -05:00

19 lines
484 B
Bash
Executable file

#!/bin/bash
if [[ -z ${ANSIBLE_SETUP_OPTIONS} ]]; then
ANSIBLE_SETUP_OPTIONS="all"
fi
if [[ -z ${SKIP_SETUP} ]]; then
echo "> Running setup (with ${ANSIBLE_SETUP_OPTIONS})..."
ansible -m setup -o all 2>&1 | awk -F'=' '{ print $1 }'
fi
if [[ -z ${SKIP_PLAYBOOK} ]]; then
if [[ -z ${ANSIBLE_OPTIONS} ]]; then
ANSIBLE_OPTIONS="playbook.yml"
fi
echo "> Running playbook (with ${ANSIBLE_OPTIONS})..."
ansible-playbook ${ANSIBLE_OPTIONS} | tee ansible-playbook.log
fi