From 7a68fdf96f2dc1db89e8c797182e311e42732b17 Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 31 Oct 2026 10:09:13 -0600 Subject: [PATCH] Wait for Gokapi's healthcheck on first run The 'Gokapi started' log line is not always flushed to log.txt, so the first-run wait timed out even though the super admin had been created. Co-Authored-By: Claude Opus 5.5 --- roles/docker/tasks/productivity/gokapi.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/docker/tasks/productivity/gokapi.yml b/roles/docker/tasks/productivity/gokapi.yml index f93ef31..60008af 100644 --- a/roles/docker/tasks/productivity/gokapi.yml +++ b/roles/docker/tasks/productivity/gokapi.yml @@ -47,10 +47,12 @@ no_log: true - name: Wait for the one-off gokapi to finish starting - ansible.builtin.wait_for: - path: /opt/stacks/gokapi/data/log.txt - search_regex: Gokapi started - timeout: 60 + ansible.builtin.command: docker inspect -f '{{ "{{" }}.State.Health.Status{{ "}}" }}' gokapi-init + register: gokapi_init_health + until: gokapi_init_health.stdout == "healthy" + retries: 30 + delay: 3 + changed_when: false always: - name: Stop the one-off gokapi ansible.builtin.command: docker rm -f gokapi-init