diff --git a/ansible/roles/observability/tasks/main.yml b/ansible/roles/observability/tasks/main.yml index add88b6..e36e56e 100644 --- a/ansible/roles/observability/tasks/main.yml +++ b/ansible/roles/observability/tasks/main.yml @@ -64,8 +64,22 @@ --namespace {{ observability_namespace }} --version {{ loki_chart_version }} --values /tmp/loki-values.yaml + register: loki_template changed_when: false +- name: Show Loki template output (check for StatefulSet) + debug: + msg: "Loki template contains StatefulSet: {{ 'kind: StatefulSet' in loki_template.stdout }}" + when: "'kind: StatefulSet' not in loki_template.stdout" + +- name: Fail if Loki template produces no StatefulSet + fail: + msg: | + Loki Helm template produces no StatefulSet. Check values configuration. + Template output (first 100 lines): + {{ loki_template.stdout.split('\n')[:100] | join('\n') }} + when: "'kind: StatefulSet' not in loki_template.stdout" + - name: Remove legacy Loki scalable workloads (if present) command: >- kubectl -n {{ observability_namespace }} delete @@ -116,7 +130,7 @@ failed_when: false changed_when: true -- name: Show Loki Helm install output +- name: Show Loki Helm install result debug: msg: | Helm install rc: {{ loki_install.rc }} @@ -124,7 +138,17 @@ {{ loki_install.stdout }} Helm install stderr: {{ loki_install.stderr }} - when: loki_install.rc != 0 + +- name: Show all Loki resources after install + command: kubectl -n {{ observability_namespace }} get all -l app.kubernetes.io/name=loki + register: loki_resources + changed_when: false + failed_when: false + +- name: Debug Loki resources + debug: + msg: "{{ loki_resources.stdout }}" + when: loki_resources.stdout | length > 0 - name: Wait for Loki statefulset rollout command: kubectl -n {{ observability_namespace }} rollout status statefulset/loki --timeout=10m