diff --git a/ansible/check/roles/ceph/tasks/main.yml b/ansible/check/roles/ceph/tasks/main.yml index f23e2983b..e77a2f068 100644 --- a/ansible/check/roles/ceph/tasks/main.yml +++ b/ansible/check/roles/ceph/tasks/main.yml @@ -7,5 +7,21 @@ shell: ceph status register: ceph_status failed_when: "'HEALTH_OK' not in '{{ ceph_status.stdout }}'" - ignore_errors: True changed_when: false + ignore_errors: True + +- name: Verify RBD caching + shell: ceph --admin-daemon `ls /var/run/ceph/ceph-osd.*.asok|tail -1` config show|grep '"rbd_cache":'|grep -i true|awk '{print tolower($0)}' + register: ceph_rbd_caching + changed_when: false + ignore_errors: True + +- name: Verify RBD cache writethrough + shell: ceph --admin-daemon `ls /var/run/ceph/ceph-osd.*.asok|tail -1` config show|grep "rbd_cache_writethrough"|grep -i true|awk '{print tolower($0)}' + register: ceph_rbd_cache_writethrough + changed_when: false + ignore_errors: True + +- set_fact: + ceph_rbd_cache_writethrough_result : "{{ ceph_rbd_cache_writethrough.stdout }}" + ceph_rbd_caching_result : "{{ ceph_rbd_caching.stdout }}" diff --git a/ansible/check/site.yml b/ansible/check/site.yml index f54a7f408..dffc7d8a9 100644 --- a/ansible/check/site.yml +++ b/ansible/check/site.yml @@ -96,3 +96,17 @@ when: "'{{ tuned_profile }}' not in '{{ hostvars[item].tuned_result }}'" with_items: groups['ceph'] ignore_errors: true + + - name : Verify RBD caching + fail : + msg: "Verify RBD caching check failed" + when : "'true' not in '{{ hostvars[item].ceph_rbd_caching_result }}'" + with_items: groups['ceph'] + ignore_errors: true + + - name : Verify RBD cache writethrough + fail: + msg: "Verify RBD cache writethrough check failed" + when: "'false' not in '{{ hostvars[item].ceph_rbd_cache_writethrough_result }}'" + with_items: groups['ceph'] + ignore_errors: true