Use pushd/pop approach once more

This commit is contained in:
Luke Murphy 2020-03-20 22:38:57 +01:00
parent e9815d0c32
commit 4f02999d00
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 3 additions and 6 deletions

View File

@ -17,8 +17,7 @@ function run_playbook() {
validate_dependencies validate_dependencies
export ANSIBLE_ROLES_PATH="$DOKKU_LIB_ROOT/data/ansible/$APP/roles" pushd "$DOKKU_LIB_ROOT/data/ansible/$APP" >/dev/null
export ANSIBLE_LIBRARY="$DOKKU_LIB_ROOT/data/ansible/$APP/roles/*/library"
if [[ ! -f "$play_path" ]]; then if [[ ! -f "$play_path" ]]; then
dokku_col_log_info1_quiet "$play_path not found or executable bit not set" dokku_col_log_info1_quiet "$play_path not found or executable bit not set"
@ -27,19 +26,17 @@ function run_playbook() {
if [[ -f "$requirements" ]]; then if [[ -f "$requirements" ]]; then
dokku_col_log_info1_quiet "$requirements file found" dokku_col_log_info1_quiet "$requirements file found"
dokku_col_log_info1_quiet "Using $ANSIBLE_ROLES_PATH as role path"
ansible-galaxy \ ansible-galaxy \
install \ install \
--force \ --force \
--roles-path "$ANSIBLE_ROLES_PATH" \
--role-file "$requirements" --role-file "$requirements"
fi fi
dokku_col_log_info1_quiet "$play_path file found" dokku_col_log_info1_quiet "$play_path file found"
dokku_col_log_info1_quiet "Using $ANSIBLE_LIBRARY as module path"
ansible-playbook \ ansible-playbook \
--inventory "$(hostname)", \ --inventory "$(hostname)", \
--connection local \ --connection local \
--module-path "$ANSIBLE_LIBRARY" \
"$play_path" "$play_path"
popd >/dev/null
} }