]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
purge-cluster: use ceph_volume module to zap and destroy OSDs
authorAndrew Schoen <aschoen@redhat.com>
Wed, 14 Mar 2018 16:32:19 +0000 (11:32 -0500)
committerSébastien Han <seb@redhat.com>
Tue, 10 Apr 2018 12:19:21 +0000 (14:19 +0200)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
infrastructure-playbooks/purge-cluster.yml

index b8945f7b3a3b8f2f1529d6523fc3402c1c419b8e..ab968c1c022b66429550204336cd2adae33083dc 100644 (file)
     failed_when: false
     register: ceph_lockbox_partition_to_erase_path
 
-  # this should go away once 'ceph-volume lvm zap' is available
-  - name: remove osd logical volumes
-    command: "lvremove -f {{ item.data_vg }}/{{ item.data }}"
-    with_items: "{{ lvm_volumes }}"
-    when:
-      - osd_scenario == "lvm"
-
-  # this should go away once 'ceph-volume lvm zap' is available
-  - name: remove osd lvm journals
-    command: "lvremove -f {{ item.journal_vg }}/{{ item.journal }}"
+  - name: zap and destroy OSDs created by ceph-volume
+    ceph_volume:
+      objectstore: "{{ osd_objectstore }}"
+      data: "{{ item.data }}"
+      data_vg: "{{ item.data_vg|default(omit) }}"
+      journal: "{{ item.journal|default(omit) }}"
+      journal_vg: "{{ item.journal_vg|default(omit) }}"
+      db: "{{ item.db|default(omit) }}"
+      db_vg: "{{ item.db_vg|default(omit) }}"
+      wal: "{{ item.wal|default(omit) }}"
+      wal_vg: "{{ item.wal_vg|default(omit) }}"
+      zap: True
+      state: absent
+    environment:
+      CEPH_VOLUME_DEBUG: 1
     with_items: "{{ lvm_volumes }}"
-    # journals might be logical volumes, but they could also be
-    # devices so fail silently if this doesn't work
-    failed_when: false
     when:
       - osd_scenario == "lvm"
-      - item.journal_vg is defined
 
   - name: get ceph block partitions
     shell: |