]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Fix activation of disks with auto discovery 563/head
authorChris St. Pierre <chris.a.st.pierre@gmail.com>
Wed, 24 Feb 2016 22:09:34 +0000 (16:09 -0600)
committerChris St. Pierre <chris.a.st.pierre@gmail.com>
Wed, 24 Feb 2016 22:09:34 +0000 (16:09 -0600)
With osd_auto_discovery enabled, the 'devices' list isn't
meaningful. We should activate ansible_devices instead.

roles/ceph-osd/tasks/activate_osds.yml

index 9b1088be57ced692da90c5f343134445a2b850d9..956c0cc5bb66b65326dec6a3bff03d07e30f51c8 100644 (file)
@@ -1,6 +1,18 @@
 ---
 # NOTE (leseb) : this task is for disk devices only because of the explicit use of the first
 # partition.
+
+- name: automatically activate osd disk(s) without partitions
+  command: ceph-disk activate "/dev/{{ item.key }}"
+  ignore_errors: true
+  with_dict: ansible_devices
+  when:
+    ansible_devices is defined and
+    item.value.removable == "0" and
+    item.value.partitions|count == 0 and
+    journal_collocation and
+    osd_auto_discovery
+
 - name: activate osd(s) when device is a disk
   command: ceph-disk activate {{ item.1 | regex_replace('^(\/dev\/cciss\/c[0-9]{1}d[0-9]{1})$', '\\1p') }}1
   with_together:
@@ -10,7 +22,8 @@
   failed_when: false
   when:
     not item.0.get("skipped") and
-    item.0.get("rc", 0) != 0
+    item.0.get("rc", 0) != 0 and
+    not osd_auto_discovery
 
 # NOTE (leseb): this task is for partitions because we don't explicitly use a partition.
 - name: activate osd(s) when device is a partition
@@ -22,7 +35,8 @@
   failed_when: false
   when:
     not item.0.get("skipped") and
-    item.0.get("rc", 0) == 0
+    item.0.get("rc", 0) != 0 and
+    not osd_auto_discovery
 
 - include: osd_fragment.yml
   when: crush_location