Localise command calling

This commit is contained in:
Luke Murphy 2020-03-20 00:42:02 +01:00
parent 9e48f5e454
commit 5c6baaac58
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 6 additions and 4 deletions

View File

@ -14,21 +14,23 @@ function run_playbook() {
exit 0
fi
pushd "$DOKKU_LIB_ROOT/data/ansible/$APP/" >/dev/null
if [[ -f "$requirements" ]]; then
dokku_col_log_info1_quiet "$requirements file found"
ansible-galaxy \
install \
-vvv --force \
--roles-path "$DOKKU_LIB_ROOT/data/ansible/$APP/roles" \
--roles-path "./roles" \
--role-file "$requirements"
fi
export ANSIBLE_ROLES_PATH="$DOKKU_LIB_ROOT/data/ansible/$APP/roles/"
dokku_col_log_info1_quiet "$play_path file found"
ansible-playbook \
--inventory "$(hostname)", \
--module-path "$ANSIBLE_ROLES_PATH/*/library/" \
--module-path "./roles/*/library/" \
--connection local \
"$play_path"
popd >/dev/null
}