From be7f8ab89b8eb0f814bdda6c7a27fd8660157dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Fri, 11 Apr 2014 16:34:33 +0200 Subject: [PATCH] Add a purge playbook to remove Ceph MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The playbook removes packages, configuration files and ALL THE DATA from Ceph. Signed-off-by: Sébastien Han --- purge.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 purge.yml diff --git a/purge.yml b/purge.yml new file mode 100644 index 000000000..218c9ceb5 --- /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