Add dependency check

This commit is contained in:
Luke Murphy 2020-03-20 22:25:59 +01:00
parent 8748b09dce
commit e9815d0c32
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 7 additions and 0 deletions

View File

@ -4,12 +4,19 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
function validate_dependencies() {
if ! command -v "ansible-playbook" &>/dev/null; then
log-fail "Missing ansible-playbook, run dokku plugin:install-dependencies"
fi
}
function run_playbook() {
local app="$1"
local play_path="$2"
local requirements="$3"
validate_dependencies
export ANSIBLE_ROLES_PATH="$DOKKU_LIB_ROOT/data/ansible/$APP/roles"
export ANSIBLE_LIBRARY="$DOKKU_LIB_ROOT/data/ansible/$APP/roles/*/library"