ceph-osd: fail when ceph-disk fails to prepare an OSD

Signed-off-by: Alfredo Deza <adeza@redhat.com>
pull/794/head
Alfredo Deza 2016-05-18 08:09:26 -04:00
parent 60b3121d2b
commit 52f73f30c5
1 changed files with 10 additions and 0 deletions

View File

@ -18,6 +18,7 @@
- raw_journal_devices - raw_journal_devices
changed_when: false changed_when: false
ignore_errors: true ignore_errors: true
register: prepare_osd_disk
when: when:
- not item.0.get("skipped") - not item.0.get("skipped")
- not item.1.get("skipped") - not item.1.get("skipped")
@ -26,4 +27,13 @@
- raw_multi_journal - raw_multi_journal
- not osd_auto_discovery - not osd_auto_discovery
- name: fail if ceph-disk cannot prepare an OSD
fail:
msg: "ceph-disk failed to prepare an OSD"
when:
- " 'ceph-disk: Error:' in item.get('stderr', '') "
- " 'Failed to add' in item.get('stderr', '') "
- item.get("rc") != 0
with_items: "{{prepare_osd_disk.results}}"
- include: ../activate_osds.yml - include: ../activate_osds.yml