diff --git a/releasenotes/notes/add-ceph-health-check-000bab9581c759d3.yaml b/releasenotes/notes/add-ceph-health-check-000bab9581c759d3.yaml new file mode 100644 index 000000000..162550c14 --- /dev/null +++ b/releasenotes/notes/add-ceph-health-check-000bab9581c759d3.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds a ceph-health check which prints a warning message if Ceph cluster + is in HEALTH_WARN state at the end of the Overcloud deployment \ No newline at end of file diff --git a/validations/ceph-health.yaml b/validations/ceph-health.yaml new file mode 100644 index 000000000..fd447aae0 --- /dev/null +++ b/validations/ceph-health.yaml @@ -0,0 +1,29 @@ +--- +- hosts: controller + vars: + metadata: + name: Check the status of the ceph cluster + description: > + Uses `ceph health` to check if cluster is in HEALTH_WARN state + and prints a debug message. + + groups: + - post-deployment + tasks: + - name: Check if ceph_mon is deployed + become: true + shell: hiera -c /etc/puppet/hiera.yaml enabled_services | egrep -sq ceph_mon + ignore_errors: true + register: ceph_mon_enabled + - name: Get ceph health + become: true + shell: ceph health | awk '{print $1}' + register: ceph_health + when: + - ceph_mon_enabled|succeeded + - name: Check ceph health + warn: + msg: Ceph is in {{ ceph_health.stdout }} state. + when: + - ceph_mon_enabled|succeeded + - ceph_health.stdout == 'HEALTH_WARN'