From 5441b639f7db5cf3c8f15c07d788b98010cc7cb1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Wed, 21 Oct 2015 00:32:42 +0200 Subject: [PATCH] Do not zap disks on monitors MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We don't necessary want to wipe and delete partition of the disks on the monitor nodes, so we simply perform the operation on the OSD nodes. Signed-off-by: Sébastien Han --- purge-cluster.yml | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/purge-cluster.yml b/purge-cluster.yml index 62726e104..417ca3ea9 100644 --- a/purge-cluster.yml +++ b/purge-cluster.yml @@ -6,6 +6,23 @@ - mons - osds + tasks: + + - name: purge ceph + command: ceph-deploy purge {{ ansible_fqdn }} + delegate_to: 127.0.0.1 + + - name: remove osd data + shell: rm -rf /var/lib/ceph/osd/*/* + failed_when: false + + - name: purge remaining data + command: ceph-deploy purgedata {{ ansible_fqdn }} + delegate_to: 127.0.0.1 + +- hosts: + - osds + vars: devices: [ '/dev/sdb', '/dev/sdc', '/dev/sdd', '/dev/sde', '/dev/sdf' ] partitions: [ '1', '2', '3' ] @@ -17,22 +34,10 @@ with_items: devices failed_when: false - - name: disk zap + - name: disk zap again command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }} with_items: devices failed_when: false - - name: purge ceph - command: ceph-deploy purge {{ ansible_fqdn }} - delegate_to: 127.0.0.1 - - - name: remove osd data - shell: rm -rf /var/lib/ceph/osd/*/* - failed_when: false - - - name: purge remaining data - command: ceph-deploy purgedata {{ ansible_fqdn }} - delegate_to: 127.0.0.1 - - name: call partprobe command: partprobe -- 2.47.3