From bff899499ae5a516e20edcfd0be6b7dd13d49125 Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Wed, 21 Jan 2026 17:33:56 -0800 Subject: [PATCH] Fix torrent sync readiness check and remove indri transmission/kiwix roles - Fix sync script to accept HTTP 409 as "ready" (transmission RPC behavior) - Remove transmission, transmission_metrics, kiwix roles from indri.yml Co-Authored-By: Claude Opus 4.5 --- ansible/playbooks/indri.yml | 7 +------ argocd/manifests/kiwix/configmap-sync-script.yaml | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/ansible/playbooks/indri.yml b/ansible/playbooks/indri.yml index 5418bc0..61a958d 100644 --- a/ansible/playbooks/indri.yml +++ b/ansible/playbooks/indri.yml @@ -30,12 +30,7 @@ - role: prometheus tags: prometheus # NOTE: grafana role removed - now hosted in k8s (see argocd/apps/grafana.yaml) - - role: transmission - tags: transmission - - role: transmission_metrics - tags: transmission_metrics - - role: kiwix - tags: kiwix + # NOTE: transmission, transmission_metrics, kiwix roles removed - now hosted in k8s (see argocd/apps/torrent.yaml, argocd/apps/kiwix.yaml) - role: borgmatic tags: borgmatic - role: borgmatic_metrics diff --git a/argocd/manifests/kiwix/configmap-sync-script.yaml b/argocd/manifests/kiwix/configmap-sync-script.yaml index 8a8ec44..5be8cae 100644 --- a/argocd/manifests/kiwix/configmap-sync-script.yaml +++ b/argocd/manifests/kiwix/configmap-sync-script.yaml @@ -18,10 +18,11 @@ data: echo "Syncing ZIM torrents to transmission at ${TRANSMISSION_HOST}:${TRANSMISSION_PORT}" # Wait for transmission to be ready + # Transmission RPC returns 409 on first request (to provide session ID), which is fine echo "Waiting for Transmission RPC..." max_attempts=30 attempt=0 - until curl -sf "http://${TRANSMISSION_HOST}:${TRANSMISSION_PORT}/transmission/rpc" >/dev/null 2>&1; do + until curl -s -o /dev/null -w "%{http_code}" "http://${TRANSMISSION_HOST}:${TRANSMISSION_PORT}/transmission/rpc" | grep -qE "^(200|409)$"; do attempt=$((attempt + 1)) if [[ $attempt -ge $max_attempts ]]; then echo "Transmission not ready after ${max_attempts} attempts, will retry next cycle"