🔨 Try with args as list
This commit is contained in:
parent
c85bcb9d44
commit
8cfae7c22a
18
entrypoint
18
entrypoint
@ -23,13 +23,13 @@ else
|
|||||||
run_command chmod 400 /root/.ssh/id_ed25519
|
run_command chmod 400 /root/.ssh/id_ed25519
|
||||||
fi
|
fi
|
||||||
|
|
||||||
args="$PLUGIN_PLAYBOOK"
|
args=("$PLUGIN_PLAYBOOK")
|
||||||
|
|
||||||
if [[ -n "$PLUGIN_VAULT_TOKEN" ]]; then
|
if [[ -n "$PLUGIN_VAULT_TOKEN" ]]; then
|
||||||
echo "Adding vault token to 'credentials/vault_token'"
|
echo "Adding vault token to 'credentials/vault_token'"
|
||||||
run_command "mkdir credentials"
|
run_command "mkdir credentials"
|
||||||
echo "$PLUGIN_VAULT_TOKEN" > credentials/vault_token
|
echo "$PLUGIN_VAULT_TOKEN" > credentials/vault_token
|
||||||
args="$args --vault-password-file credentials/vault_token"
|
args+=("--vault-password-file" "credentials/vault_token")
|
||||||
echo ""
|
echo ""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -45,23 +45,25 @@ if [[ -n "$PLUGIN_GALAXY_FILE" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $check = true ]]; then
|
if [[ $check = true ]]; then
|
||||||
args="$args --syntax-check"
|
args+=("--syntax-check")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $verbosity != "0" ]]; then
|
if [[ $verbosity != "0" ]]; then
|
||||||
args="${args} -"
|
verb="-"
|
||||||
for i in `seq 1 $verbosity`; do
|
for i in `seq 1 $verbosity`; do
|
||||||
args="${args}v"
|
verb+="v"
|
||||||
done
|
done
|
||||||
|
args+=("$verb")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$PLUGIN_LIMIT" ]]; then
|
if [[ -n "$PLUGIN_LIMIT" ]]; then
|
||||||
args="${args} --limit \"$PLUGIN_LIMIT\""
|
args+=("--limit" "\"$PLUGIN_LIMIT\"")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$PLUGIN_TAGS" ]]; then
|
if [[ -n "$PLUGIN_TAGS" ]]; then
|
||||||
args="${args} --tags \"$PLUGIN_TAGS\""
|
args+=("--tags" "\"$PLUGIN_TAGS\"")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_command "export ANSIBLE_HOST_KEY_CHECKING=False"
|
run_command "export ANSIBLE_HOST_KEY_CHECKING=False"
|
||||||
run_command "ansible-playbook $args"
|
echo "ansible-playbook ${args[@]}"
|
||||||
|
ansible-playbook "${args[@]}"
|
Loading…
Reference in New Issue
Block a user