]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
if ceph-disk fails to activate an OSD then bubble up the error 703/head
authorAlfredo Deza <adeza@redhat.com>
Mon, 11 Apr 2016 14:28:03 +0000 (10:28 -0400)
committerAlfredo Deza <adeza@redhat.com>
Mon, 11 Apr 2016 19:29:29 +0000 (15:29 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
roles/ceph-osd/tasks/activate_osds.yml

index 0ee388b5cf4008a0a9a8d510006d725c0b8dff88..47e488cfca7c1b93dec4ae90139c0f71d2a44b87 100644 (file)
     - 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 }}"