Rename shorter command and add default
This commit is contained in:
parent
e6aa8fa4d1
commit
fe3baa4eb2
2
commands
2
commands
@ -11,7 +11,7 @@ case "$1" in
|
|||||||
#shellcheck disable=SC2034
|
#shellcheck disable=SC2034
|
||||||
declare desc="return ansible-playbook plugin help content"
|
declare desc="return ansible-playbook plugin help content"
|
||||||
cat<<help_content
|
cat<<help_content
|
||||||
ansible:add-vault-password, Insert new vault password for encrypt/decrypt of passwords
|
ansible:vault-pass, Insert new vault password for encrypt/decrypt of passwords
|
||||||
help_content
|
help_content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
subcommands/default
Executable file
16
subcommands/default
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
ansible_default_cmd() {
|
||||||
|
echo -e 'Usage: dokku ansible[:COMMAND]'
|
||||||
|
echo ''
|
||||||
|
echo 'Run ansible playbooks during deployment'
|
||||||
|
echo ''
|
||||||
|
echo 'Commands:'
|
||||||
|
cat<<help_content
|
||||||
|
ansible:vault-pass, Insert new vault password for encrypt/decrypt of passwords
|
||||||
|
help_content
|
||||||
|
}
|
||||||
|
|
||||||
|
ansible_default_cmd "$@"
|
@ -4,11 +4,11 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|||||||
|
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||||
|
|
||||||
ansible_add_vault_password_cmd() {
|
ansible_vault_pass_cmd() {
|
||||||
#shellcheck disable=SC2034
|
#shellcheck disable=SC2034
|
||||||
declare desc="insert new vault password for encrypt/decrypt of passwords"
|
declare desc="insert new vault password for encrypt/decrypt of passwords"
|
||||||
|
|
||||||
if [[ -f "$DOKKU_LIB/data/ansible/.vault-password" ]]; then
|
if [[ -f "$DOKKU_LIB/data/ansible/.vault-pass" ]]; then
|
||||||
dokku_col_log_info1_quiet "Vault password already in place"
|
dokku_col_log_info1_quiet "Vault password already in place"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@ -20,9 +20,9 @@ ansible_add_vault_password_cmd() {
|
|||||||
mkdir -p "$DOKKU_LIB/data/ansible"
|
mkdir -p "$DOKKU_LIB/data/ansible"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dokku_col_log_info1_quiet "Generating $DOKKU_LIB/data/ansible/.vault-password"
|
dokku_col_log_info1_quiet "Generating $DOKKU_LIB/data/ansible/.vault-pass"
|
||||||
echo "$vault_password" > "$DOKKU_LIB/data/ansible/.vault-password"
|
echo "$vault_password" > "$DOKKU_LIB/data/ansible/.vault-pass"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ansible_add_vault_password_cmd "$@"
|
ansible_vault_pass_cmd "$@"
|
Reference in New Issue
Block a user