From e9815d0c3257d3d4b4169dfcfe863dfd2bada306 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Fri, 20 Mar 2020 22:25:59 +0100 Subject: [PATCH] Add dependency check --- functions | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/functions b/functions index 58b22fd..641bd4f 100755 --- a/functions +++ b/functions @@ -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"