Merge "Added checks for RBD caching and cache writethrough"

This commit is contained in:
Alex Krzos 2015-12-09 19:00:06 +01:00 committed by Gerrit Code Review
commit ee77618d7f
2 changed files with 31 additions and 1 deletions

View File

@ -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 }}"

View File

@ -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