]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Make zap option more secure 320/head
authorleseb <seb@redhat.com>
Mon, 6 Jul 2015 16:53:31 +0000 (18:53 +0200)
committerleseb <seb@redhat.com>
Mon, 6 Jul 2015 16:53:31 +0000 (18:53 +0200)
Prior to this change, the zap was executed during every play, this was
not ideal. Now we do check if there is a 'ceph' partition. If so we skip
the zap.

Signed-off-by: leseb <seb@redhat.com>
roles/ceph-osd/tasks/journal_collocation.yml
roles/ceph-osd/tasks/raw_multi_journal.yml
roles/ceph-osd/tasks/zap_devices.yml

index 613715eea855d6f6e1c0cedaaaf6469040ff136e..394e49ecba52857c57a13693a69258fac5d87049 100644 (file)
@@ -1,8 +1,8 @@
 ---
 ## SCENARIO 1: JOURNAL AND OSD_DATA ON THE SAME DEVICE
 
-- include: zap_devices.yml
 - include: check_devices.yml
+- include: zap_devices.yml
 
 # NOTE (leseb): the prepare process must be parallelized somehow...
 # if you have 64 disks with 4TB each, this will take a while
index 76b7f0ff0574f73cdd013d714d0255a73fee3c54..c85a041088a730febd255a563d9f0b18c81651bd 100644 (file)
@@ -1,8 +1,8 @@
 ---
 ## SCENARIO 3: N JOURNAL DEVICES FOR N OSDS
 
-- include: zap_devices.yml
 - include: check_devices.yml
+- include: zap_devices.yml
 
 # NOTE (leseb): the prepare process must be parallelized somehow...
 # if you have 64 disks with 4TB each, this will take a while
index 9180daa09083ff91759d6f92a1d2732bc8e62de2..afe5a365d6eda8cc03ba5c4a2c7219204d8cb0b7 100644 (file)
@@ -3,17 +3,27 @@
 # in ceph-disk failing to prepare OSD. Thus zapping them prior to prepare the OSD
 # ensures that the device will get successfully prepared.
 - name: erasing partitions and labels from OSD disk(s)
-  command: ceph-disk zap {{ item }}
-  with_items: devices
+  command: ceph-disk zap {{ item.2 }}
   changed_when: false
+  with_together:
+    - parted.results
+    - ispartition.results
+    - devices
   when:
+    item.0.rc != 0 and
+    item.1.rc != 0 and
     zap_devices and
     (journal_collocation or raw_multi_journal)
 
 - name: erasing partitions and labels from the journal device(s)
-  command: ceph-disk zap {{ item }}
-  with_items: raw_journal_devices
+  command: ceph-disk zap {{ item.2 }}
   changed_when: false
+  with_together:
+    - parted.results
+    - ispartition.results
+    - raw_journal_devices
   when:
+    item.0.rc != 0 and
+    item.1.rc != 0 and
     zap_devices and
     raw_multi_journal