]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Do not prepare skipped disks
authorChris St. Pierre <chris.a.st.pierre@gmail.com>
Wed, 24 Feb 2016 16:25:26 +0000 (10:25 -0600)
committerChris St. Pierre <chris.a.st.pierre@gmail.com>
Wed, 24 Feb 2016 20:50:37 +0000 (14:50 -0600)
When autodiscovering disks, disks can be skipped if either they are
removable, or if they have partitions on them. Skipped actions have no
'rc' attribute, though, so the 'ceph prepare' conditional fails unless
we first check to ensure that the results were not skipped before
checking the return value.

roles/ceph-osd/tasks/activate_osds.yml
roles/ceph-osd/tasks/scenarios/journal_collocation.yml
roles/ceph-osd/tasks/scenarios/raw_multi_journal.yml

index e0c11f56b023bc6561691a60df9e2fb65613d2f6..9b1088be57ced692da90c5f343134445a2b850d9 100644 (file)
@@ -8,7 +8,9 @@
     - devices
   changed_when: false
   failed_when: false
-  when: item.0.rc != 0
+  when:
+    not item.0.get("skipped") and
+    item.0.get("rc", 0) != 0
 
 # NOTE (leseb): this task is for partitions because we don't explicitly use a partition.
 - name: activate osd(s) when device is a partition
@@ -18,7 +20,9 @@
     - devices
   changed_when: false
   failed_when: false
-  when: item.0.rc == 0
+  when:
+    not item.0.get("skipped") and
+    item.0.get("rc", 0) == 0
 
 - include: osd_fragment.yml
   when: crush_location
index eff482bf9f971caabfe08d7902128d242ea5b393..92102d44c691a60de53ad35c325242362917018f 100644 (file)
     - combined_ispartition_results.results
     - devices
   when:
-    item.0.rc != 0 and
-    item.1.rc != 0 and
+    not item.0.get("skipped") and
+    not item.1.get("skipped") and
+    item.0.get("rc", 0) != 0 and
+    item.1.get("rc", 0) != 0 and
     journal_collocation and not
     osd_auto_discovery
 
index 37f4aed20903866e1d1ddd841da34c710c2f189f..32f5a450f04a2d3efe58e5c74ea4ee417da63df5 100644 (file)
   changed_when: false
   ignore_errors: true
   when:
-    item.0.rc != 0 and
-    item.1.rc != 0 and
+    not item.0.get("skipped") and
+    not item.1.get("skipped") and
+    item.0.get("rc", 0) != 0 and
+    item.1.get("rc", 0) != 0 and
     raw_multi_journal and
     not osd_auto_discovery