This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
dokku-ansible-playbook/functions

22 lines
489 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
function run_playbook() {
local play_path="$1"
local requirements="$2"
if [[ ! -f "$play_path" ]]; then
echo "-----> $play_path not found or executable bit not set"
exit 0
fi
if [[ -f "$requirements" ]]; then
echo "-----> $requirements file found"
ansible-galaxy install -fr "$requirements"
fi
echo "-----> $play_path file found"
ansible-playbook -i 127.0.0.1, -c local "$play_path"
}