2016-09-22 23:03:14 +08:00
|
|
|
---
|
|
|
|
- name: collect osds
|
|
|
|
shell: |
|
2017-02-20 16:35:56 +08:00
|
|
|
ls /var/lib/ceph/osd/ |grep -oP '\d+$'
|
2016-09-22 23:03:14 +08:00
|
|
|
register: osd_ids
|
|
|
|
|
|
|
|
- name: wait for ceph osd socket(s)
|
|
|
|
wait_for:
|
|
|
|
path: "/var/run/ceph/{{ cluster }}-osd.{{ item }}.asok"
|
|
|
|
with_items: "{{ osd_ids.stdout_lines }}"
|
|
|
|
|
|
|
|
- name: waiting for clean pgs...
|
|
|
|
shell: |
|
|
|
|
test "$(ceph --cluster {{ cluster }} pg stat | sed 's/^.*pgs://;s/active+clean.*//;s/ //')" -eq "$(ceph --cluster {{ cluster }} pg stat | sed 's/pgs.*//;s/^.*://;s/ //')" && ceph --cluster {{ cluster }} health | egrep -sq "HEALTH_OK|HEALTH_WARN"
|
|
|
|
register: result
|
|
|
|
until: result.rc == 0
|
|
|
|
retries: "{{ handler_health_osd_check_retries }}"
|
|
|
|
delay: "{{ handler_health_osd_check_delay }}"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2017-02-02 18:22:55 +08:00
|
|
|
when: handler_health_osd_check
|