Refactor options usage
This commit is contained in:
parent
e8458d041a
commit
4059039bc3
20
functions
20
functions
@ -14,7 +14,7 @@ function run_playbook() {
|
|||||||
local app="$1"
|
local app="$1"
|
||||||
local play_path="$2"
|
local play_path="$2"
|
||||||
local requirements="$3"
|
local requirements="$3"
|
||||||
local vault_file="$DOKKU_LIB/ansible/$APP/.vault.sh"
|
local vault_file="$DOKKU_LIB/ansible/$app/.vault.sh"
|
||||||
|
|
||||||
validate_dependencies
|
validate_dependencies
|
||||||
|
|
||||||
@ -32,19 +32,13 @@ function run_playbook() {
|
|||||||
mkdir -p $DOKKU_ROOT/.ansible/{roles,plugins/modules}
|
mkdir -p $DOKKU_ROOT/.ansible/{roles,plugins/modules}
|
||||||
cp -R $DOKKU_ROOT/.ansible/roles/*/library/* $DOKKU_ROOT/.ansible/plugins/modules
|
cp -R $DOKKU_ROOT/.ansible/roles/*/library/* $DOKKU_ROOT/.ansible/plugins/modules
|
||||||
|
|
||||||
|
local args="--inventory "$(hostname)", --connection local"
|
||||||
|
|
||||||
if [[ -f "$vault_file" ]]; then
|
if [[ -f "$vault_file" ]]; then
|
||||||
dokku_col_log_info1_quiet "$play_path file found"
|
|
||||||
dokku_col_log_info1_quiet "$vault_file file found"
|
dokku_col_log_info1_quiet "$vault_file file found"
|
||||||
ansible-playbook \
|
args+="--vault-password-file \"$vault_file\""
|
||||||
--inventory "$(hostname)", \
|
|
||||||
--connection local \
|
|
||||||
--vault-password-file "$vault_file"
|
|
||||||
"$play_path"
|
|
||||||
else
|
|
||||||
dokku_col_log_info1_quiet "$play_path file found"
|
|
||||||
ansible-playbook \
|
|
||||||
--inventory "$(hostname)", \
|
|
||||||
--connection local \
|
|
||||||
"$play_path"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dokku_col_log_info1_quiet "$play_path file found"
|
||||||
|
ansible-playbook "$args" "$play_path"
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user