Compare commits
1 Commits
765c313800
...
ef7f180606
Author | SHA1 | Date | |
---|---|---|---|
|
ef7f180606 |
@ -4,7 +4,7 @@ RUN apt-get update && apt-get install -y git \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# renovate: datasource=pypi depName=ansible
|
||||
ENV ANSIBLE_VERSION=5.5.0
|
||||
ENV ANSIBLE_VERSION=5.4.0
|
||||
RUN pip3 install --no-cache-dir ansible==${ANSIBLE_VERSION} dnspython
|
||||
|
||||
COPY entrypoint /bin/entrypoint
|
||||
|
@ -24,9 +24,7 @@ steps:
|
||||
- name: Run ansible playbook
|
||||
image: harbor.sebclem.fr/sebclem/drone-ansible-runner
|
||||
settings:
|
||||
verbosity: ${verbosity=1}
|
||||
limit: ${limit}
|
||||
tags: ${tags}
|
||||
verbosity: 1
|
||||
playbook: sites.yml
|
||||
galaxy_file: roles/requirements.yml
|
||||
check_syntax: true
|
||||
|
20
entrypoint
20
entrypoint
@ -23,13 +23,13 @@ else
|
||||
run_command chmod 400 /root/.ssh/id_ed25519
|
||||
fi
|
||||
|
||||
args=("$PLUGIN_PLAYBOOK")
|
||||
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+=("--vault-password-file" "credentials/vault_token")
|
||||
args="$args --vault-password-file credentials/vault_token"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
@ -45,25 +45,19 @@ if [[ -n "$PLUGIN_GALAXY_FILE" ]]; then
|
||||
fi
|
||||
|
||||
if [[ $check = true ]]; then
|
||||
args+=("--syntax-check")
|
||||
args="$args --syntax-check"
|
||||
fi
|
||||
|
||||
if [[ $verbosity != "0" ]]; then
|
||||
verb="-"
|
||||
args="${args} -"
|
||||
for i in `seq 1 $verbosity`; do
|
||||
verb+="v"
|
||||
args="${args}v"
|
||||
done
|
||||
args+=("$verb")
|
||||
fi
|
||||
|
||||
if [[ -n "$PLUGIN_LIMIT" ]]; then
|
||||
args+=("--limit" "$PLUGIN_LIMIT")
|
||||
fi
|
||||
|
||||
if [[ -n "$PLUGIN_TAGS" ]]; then
|
||||
args+=("--tags" "$PLUGIN_TAGS")
|
||||
args="${args} --limit \"$PLUGIN_LIMIT\""
|
||||
fi
|
||||
|
||||
run_command "export ANSIBLE_HOST_KEY_CHECKING=False"
|
||||
echo "ansible-playbook ${args[@]}"
|
||||
ansible-playbook "${args[@]}"
|
||||
run_command "ansible-playbook $args"
|
Reference in New Issue
Block a user