From 17a08adb0355f17afecc152bb1d7bbedb7906e9e Mon Sep 17 00:00:00 2001 From: John Fulton Date: Mon, 16 Dec 2024 21:57:06 -0500 Subject: [PATCH] Log Ceph health and do not fail on HEALTH_WARN The Ceph Upgrade tasks in the cifmw_cephadm role will fail before the upgrade starts if the health status is warn or error. This patch changes it so that the upgrade only fails if the cluster is in health error. We have had the job fail in CI but we do not know why. The task should log the Ceph health before starting the upgrade so that CI results will give the job owner more insight into why the job failed. Signed-off-by: John Fulton --- roles/cifmw_cephadm/tasks/ceph_upgrade.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/cifmw_cephadm/tasks/ceph_upgrade.yml b/roles/cifmw_cephadm/tasks/ceph_upgrade.yml index 31b8f33872..a2982cdf10 100644 --- a/roles/cifmw_cephadm/tasks/ceph_upgrade.yml +++ b/roles/cifmw_cephadm/tasks/ceph_upgrade.yml @@ -18,12 +18,15 @@ ansible.builtin.set_fact: ceph_health: "{{ ceph.stdout | from_json }}" -- name: Fail if health is HEALTH_WARN || HEALTH_ERR +- name: Log ceph health for debug purposes + ansible.builtin.debug: + var: ceph_health + +- name: Fail if health is HEALTH_ERR ansible.builtin.fail: msg: Ceph is in {{ ceph_health.health.status }} state. when: - - ceph_health.health.status == 'HEALTH_WARN' or - ceph_health.health.status == 'HEALTH_ERR' + - ceph_health.health.status == 'HEALTH_ERR' - name: Build container image target ansible.builtin.set_fact: