From b76bce16e08399e7a1349e24d90bdfc446773464 Mon Sep 17 00:00:00 2001 From: sebclem Date: Sun, 23 Jan 2022 18:21:24 +0100 Subject: [PATCH] Update 'entrypoint' --- entrypoint | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/entrypoint b/entrypoint index 370caa1..86fea88 100755 --- a/entrypoint +++ b/entrypoint @@ -23,21 +23,27 @@ else run_command chmod 400 /root/.ssh/id_ed25519 fi +args="$PLUGIN_PLAYBOOK" + if [[ -n "$PLUGIN_VAULT_TOKEN" ]]; then echo "Adding vault token to 'credentials/vault_token'" run_command "mkdir credentials" echo "$PLUGIN_VAULT_TOKEN" > credentials/vault_token + args="$args --vault-password-file credentials/vault_token" echo "" fi +if [[ -f "ansible-ci.cfg" ]]; then + rm ansible.cfg + mv ansible-ci.cfg ansible.cfg +fi + if [[ -n "$PLUGIN_GALAXY_FILE" ]]; then echo "Installing Galaxy dependencies ($PLUGIN_GALAXY_FILE)" run_command "ansible-galaxy install -r $PLUGIN_GALAXY_FILE --force" echo "" fi -args="$PLUGIN_PLAYBOOK" - if [[ $check = true ]]; then args="$args --syntax-check" fi @@ -53,10 +59,5 @@ if [[ -n "$PLUGIN_LIMIT" ]]; then args="${args} --limit \"$PLUGIN_LIMIT\"" fi -if [[ -f "ansible-ci.cfg" ]]; then - rm ansible.cfg - mv ansible-ci.cfg ansible.cfg -fi - run_command "export ANSIBLE_HOST_KEY_CHECKING=False" run_command "ansible-playbook $args" \ No newline at end of file