]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
fix: when osd device is a disk partition 1690/head
authoryanyx <yanyx@umcloud.com>
Tue, 18 Jul 2017 06:56:12 +0000 (14:56 +0800)
committeryanyx <yanyx@umcloud.com>
Tue, 25 Jul 2017 13:39:43 +0000 (21:39 +0800)
infrastructure-playbooks/purge-cluster.yml

index 5a756fd92e47682afb03405d2808c0f38c8d5296..b1f1685eb72fd00e7f9d6679235e3fe7c419f7e7 100644 (file)
     when: "{{ encrypted_ceph_partuuid.stdout_lines | length > 0 }}"
 
   - name: zap osd disks
-    shell: ceph-disk zap "{{ item }}"
+    shell: |
+      if (echo "{{ item }}" | grep -Esq '[0-9]{1,2}$'); then
+        raw_device=$(echo "{{ item }}" | grep -Eo '/dev/([hsv]d[a-z]{1,2}|cciss/c[0-9]d[0-9]|nvme[0-9]n[0-9]){1,2}')
+        partition_nb=$(echo "{{ item }}" | grep -Eo '[0-9]{1,2}$')
+        sgdisk --delete $partition_nb $raw_device
+      else
+        ceph-disk zap "{{ item }}"
+      fi
     with_items: "{{ devices }}"
     when:
       - ceph_disk_present.rc == 0