From: Alfredo Deza Date: Mon, 11 Apr 2016 14:28:03 +0000 (-0400) Subject: if ceph-disk fails to activate an OSD then bubble up the error X-Git-Tag: v1.0.4~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=441d83fe77bd0351d93efe1e9472014c05648d76;p=ceph-ansible.git if ceph-disk fails to activate an OSD then bubble up the error Signed-off-by: Alfredo Deza --- diff --git a/roles/ceph-osd/tasks/activate_osds.yml b/roles/ceph-osd/tasks/activate_osds.yml index 0ee388b5c..47e488cfc 100644 --- a/roles/ceph-osd/tasks/activate_osds.yml +++ b/roles/ceph-osd/tasks/activate_osds.yml @@ -20,11 +20,19 @@ - devices changed_when: false failed_when: false + register: activate_osd_disk when: not item.0.get("skipped") and item.0.get("rc", 0) != 0 and not osd_auto_discovery +- name: fail if ceph-disk cannot create an OSD + fail: + msg: "ceph-disk failed to create an OSD" + when: + " 'ceph-disk: Error: ceph osd create failed' in item.get('stderr', '') " + with_items: "{{activate_osd_disk.results}}" + # NOTE (leseb): this task is for partitions because we don't explicitly use a partition. - name: activate osd(s) when device is a partition command: "ceph-disk activate {{ item.1 }}"