2014-04-11 22:34:33 +08:00
|
|
|
---
|
|
|
|
# This playbook purges Ceph
|
|
|
|
# It removes: packages, configuration files and ALL THE DATA
|
|
|
|
|
|
|
|
- hosts:
|
|
|
|
- mons
|
|
|
|
- osds
|
|
|
|
|
2015-10-21 06:32:42 +08:00
|
|
|
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
|
|
|
|
|
2014-08-14 20:08:52 +08:00
|
|
|
vars:
|
|
|
|
devices: [ '/dev/sdb', '/dev/sdc', '/dev/sdd', '/dev/sde', '/dev/sdf' ]
|
|
|
|
partitions: [ '1', '2', '3' ]
|
|
|
|
|
2014-04-11 22:34:33 +08:00
|
|
|
tasks:
|
|
|
|
|
2015-07-08 16:34:16 +08:00
|
|
|
- name: disk zap
|
|
|
|
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
|
|
|
|
with_items: devices
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-07-08 16:34:16 +08:00
|
|
|
|
2015-10-21 06:32:42 +08:00
|
|
|
- name: disk zap again
|
2015-07-08 16:34:16 +08:00
|
|
|
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
|
|
|
|
with_items: devices
|
2015-07-29 00:21:15 +08:00
|
|
|
failed_when: false
|
2015-07-08 16:34:16 +08:00
|
|
|
|
2015-08-03 22:20:03 +08:00
|
|
|
- name: call partprobe
|
|
|
|
command: partprobe
|