]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
dont use devices var anymore, works for osd_auto_discover 1824/head
authorBen England <bengland@redhat.com>
Mon, 28 Aug 2017 21:27:01 +0000 (17:27 -0400)
committerBen England <bengland@redhat.com>
Mon, 28 Aug 2017 21:27:01 +0000 (17:27 -0400)
infrastructure-playbooks/purge-cluster.yml

index 0ec3e1638fb6c263b99a7cfb1302fed3f305b3c7..4489e6a4198511a8145a4f15135fb4052afc0ca6 100644 (file)
 
   tasks:
 
-  - name: set devices if osd scenario is lvm
-    set_fact:
-      devices: []
-    when: osd_scenario == "lvm"
-
-  - name: check for a device list
-    fail:
-      msg: "OSD automatic discovery was detected, purge cluster does not support this scenario. If you want to purge the cluster, manually provide the list of devices in group_vars/{{ osd_group_name }} using the devices variable."
-    when:
-      - devices|length == 0
-      - osd_auto_discovery|default(false)
-
   - name: get osd numbers
     shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi"
     register: osd_ids
     with_items: "{{ encrypted_ceph_partuuid.stdout_lines }}"
     when: "{{ encrypted_ceph_partuuid.stdout_lines | length > 0 }}"
 
+  - name: get ceph data partitions
+    shell: |
+      blkid | awk -F: '/ceph data/ { print $1 }'
+    when: ceph_data_partlabels.rc == 0
+    failed_when: false
+    register: ceph_data_partition_to_erase_path
+
   - name: zap osd disks
     shell: |
       if (echo "{{ item }}" | grep -Esq '[0-9]{1,2}$'); then
       else
         ceph-disk zap "{{ item }}"
       fi
-    with_items: "{{ devices }}"
+    with_items: "{{ ceph_data_partition_to_erase_path.stdout_lines | default([]) }}"
     when:
       - ceph_disk_present.rc == 0
       - ceph_data_partlabels.rc == 0