Merge pull request #794 from ceph/issue-780

ceph-osd: fail when ceph-disk fails to prepare an OSD
pull/795/head
Leseb 2016-05-18 13:27:17 +01:00
commit 2f073584f2
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