]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add a purge playbook to remove Ceph 68/head
authorSébastien Han <sebastien.han@enovance.com>
Fri, 11 Apr 2014 14:34:33 +0000 (16:34 +0200)
committerSébastien Han <sebastien.han@enovance.com>
Mon, 14 Apr 2014 13:18:34 +0000 (15:18 +0200)
The playbook removes packages, configuration files and ALL THE DATA from
Ceph.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
purge.yml [new file with mode: 0644]

diff --git a/purge.yml b/purge.yml
new file mode 100644 (file)
index 0000000..218c9ce
--- /dev/null
+++ b/purge.yml
@@ -0,0 +1,30 @@
+---
+# This playbook purges Ceph
+# It removes: packages, configuration files and ALL THE DATA
+
+---
+
+- hosts:
+  - mons
+  - osds
+
+  tasks:
+
+  - name: Purge Ceph
+    command: ceph-deploy purge {{ ansible_hostname }}
+    delegate_to: 127.0.0.1
+
+  - name: Remove OSD data
+    shell: rm -rf /var/lib/ceph/osd/*/*
+    ignore_errors: true
+
+  - name: Purge remaining data
+    command: ceph-deploy purgedata {{ ansible_hostname }}
+    delegate_to: 127.0.0.1
+
+  - name: Purge partitions
+    shell: parted -s {{ item[0] }} rm {{ item[1] }}
+    with_nested:
+      - devices
+      - ['1', '2']
+    ignore_errors: true