Skip to content

Commit

Permalink
Log Ceph health and do not fail on HEALTH_WARN
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fultonj authored and openshift-merge-bot[bot] committed Dec 17, 2024
1 parent ff9f827 commit 17a08ad
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions roles/cifmw_cephadm/tasks/ceph_upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 17a08ad

Please sign in to comment.