From b4577c569784e0d87acd2b0e87fbadfe1005ad93 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Fri, 11 Sep 2026 15:07:03 +0200 Subject: [PATCH] CI deploy: install ansible.posix collection for authorized_key --- .ci.toml | 4 +++- deploy/deploy.sh | 2 +- deploy/roles/urlbot/templates/wait-for-rabbitmq.sh | 3 +-- logging.ini | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.ci.toml b/.ci.toml index 55b9150..99bbab9 100644 --- a/.ci.toml +++ b/.ci.toml @@ -15,11 +15,13 @@ name = "deploy" image = "docker.io/library/debian:trixie-slim" only_branches = ["refs/heads/master"] secrets = ["vault_password", "deploy_ssh_key", "deploy_ssh_key.pub"] -env = { ANSIBLE_FORCE_COLOR = "0", ANSIBLE_NOCOWS = "1" } +env = { ANSIBLE_FORCE_COLOR = "0", ANSIBLE_NOCOWS = "1", DEBIAN_FRONTEND = "noninteractive" } command = """ set -e apt-get -qq update apt-get -qq install -y --no-install-recommends ansible-core openssh-client git >/dev/null +# authorized_key is the only module the playbook uses outside ansible-core +ansible-galaxy collection install ansible.posix >/dev/null cd deploy export ANSIBLE_SSH_COMMON_ARGS="-o UserKnownHostsFile=$PWD/known_hosts -o IdentitiesOnly=yes" ansible-playbook -i hosts deploy.yml -D \\ diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 49b959d..335b6dd 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -3,7 +3,7 @@ [ "$(pwd | rev | cut -d/ -f1 | rev)" == "deploy" ] || pushd deploy || exit # shellcheck disable=SC1090 -source "${HOME}/.virtualenvs/ansible/bin/activate" +# source "${HOME}/.virtualenvs/ansible/bin/activate" export ANSIBLE_VAULT_PASSWORD_FILE=vault.sh diff --git a/deploy/roles/urlbot/templates/wait-for-rabbitmq.sh b/deploy/roles/urlbot/templates/wait-for-rabbitmq.sh index 59d65ba..5c3e59e 100644 --- a/deploy/roles/urlbot/templates/wait-for-rabbitmq.sh +++ b/deploy/roles/urlbot/templates/wait-for-rabbitmq.sh @@ -1,7 +1,6 @@ #!/bin/bash -# TODO: parse amqp_uri, insert here -while ! echo > /dev/tcp/localhost/5672; do +while ! echo > /dev/tcp/{{ amqp_uri | urlsplit('hostname') }}/{{ amqp_uri | urlsplit('port') or 5672 }}; do echo "waiting for remote service..." sleep 5s done diff --git a/logging.ini b/logging.ini index e5d1a0e..fae5151 100644 --- a/logging.ini +++ b/logging.ini @@ -8,11 +8,11 @@ keys=stream_handler keys=formatter [logger_root] -level=INFO +level=DEBUG handlers=stream_handler [logger_distbot] -level=INFO +level=DEBUG handlers=stream_handler qualname=distbot @@ -23,7 +23,7 @@ qualname=pika [handler_stream_handler] class=StreamHandler -level=INFO +level=DEBUG formatter=formatter args=(sys.stderr,) -- 2.47.3