Update 'entrypoint'

This commit is contained in:
sebclem 2022-01-23 18:21:24 +01:00
parent c14ec8723c
commit b76bce16e0

View File

@ -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"