Get roles path working
This commit is contained in:
parent
394fc3ed9e
commit
c7881d896f
15
functions
15
functions
@ -5,8 +5,9 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
function run_playbook() {
|
||||
local play_path="$1"
|
||||
local requirements="$2"
|
||||
local app="$1"
|
||||
local play_path="$2"
|
||||
local requirements="$3"
|
||||
|
||||
if [[ ! -f "$play_path" ]]; then
|
||||
dokku_col_log_info1_quiet "$play_path not found or executable bit not set"
|
||||
@ -15,9 +16,15 @@ function run_playbook() {
|
||||
|
||||
if [[ -f "$requirements" ]]; then
|
||||
dokku_col_log_info1_quiet "$requirements file found"
|
||||
ansible-galaxy install -vvv --force --role-file "$requirements"
|
||||
ansible-galaxy install \
|
||||
-vvv --force \
|
||||
--roles-path "$DOKKU_LIB_ROOT/data/ansible/$APP" \
|
||||
--role-file "$requirements"
|
||||
fi
|
||||
|
||||
dokku_col_log_info1_quiet "$play_path file found"
|
||||
ansible-playbook --inventory "$(hostname)", --connection local "$play_path"
|
||||
ANSIBLE_ROLES_PATH="$DOKKU_LIB_ROOT/data/ansible/$APP" ansible-playbook \
|
||||
--inventory "$(hostname)", \
|
||||
--connection local \
|
||||
"$play_path"
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ dokku-ansible-playbook-post-deploy() {
|
||||
|
||||
dokku_col_log_info1_quiet "Running post-deploy ansible playbook"
|
||||
|
||||
run_playbook "$PLAYBOOK" "$REQUIREMENTS"
|
||||
run_playbook "$APP" "$PLAYBOOK" "$REQUIREMENTS"
|
||||
}
|
||||
|
||||
dokku-ansible-playbook-post-deploy "$@"
|
||||
|
@ -13,7 +13,7 @@ dokku-ansible-playbook-pre-deploy() {
|
||||
|
||||
dokku_col_log_info1_quiet "Running pre-deploy ansible playbook"
|
||||
|
||||
run_playbook "$PLAYBOOK" "$REQUIREMENTS"
|
||||
run_playbook "$APP" "$PLAYBOOK" "$REQUIREMENTS"
|
||||
}
|
||||
|
||||
dokku-ansible-playbook-pre-deploy "$@"
|
||||
|
Reference in New Issue
Block a user