From 757e20fffa53a7fee9bf4356e4ff3b405e1ab4a2 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 24 Feb 2026 12:13:15 +0100 Subject: [PATCH] web-app-matomo: fail fast on bootstrap root cause --- roles/web-app-matomo/tasks/03a_bootstrap.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/roles/web-app-matomo/tasks/03a_bootstrap.yml b/roles/web-app-matomo/tasks/03a_bootstrap.yml index 051b8907e0..c2284c0020 100644 --- a/roles/web-app-matomo/tasks/03a_bootstrap.yml +++ b/roles/web-app-matomo/tasks/03a_bootstrap.yml @@ -21,11 +21,17 @@ until: matomo_bootstrap_run.rc == 0 rescue: - - name: "Load Boostrap Debug Info" + - name: "Load Bootstrap Debug Info" include_tasks: 03b_bootstrap_debug.yml - when: - - MASK_CREDENTIALS_IN_LOGS | bool - - MODE_DEBUG | bool + when: MODE_DEBUG | bool + + - name: "Matomo bootstrap | Abort with bootstrap root cause" + ansible.builtin.fail: + msg: >- + Matomo bootstrap run failed after {{ matomo_bootstrap_run.attempts | default(MATOMO_BOOTSTRAP_RETRIES) }} attempt(s) + with rc={{ matomo_bootstrap_run.rc | default('n/a') }}. + stderr={{ (matomo_bootstrap_run.stderr | default('') | trim) if not (MASK_CREDENTIALS_IN_LOGS | bool) else ('') }} + stdout={{ (matomo_bootstrap_run.stdout | default('') | trim) if not (MASK_CREDENTIALS_IN_LOGS | bool) else ('') }} - name: "Matomo bootstrap | Set effective token (prefer existing, else parse bootstrap stdout)" ansible.builtin.set_fact: