2014-04-11 22:34:33 +08:00
|
|
|
---
|
|
|
|
# This playbook purges Ceph
|
|
|
|
# It removes: packages, configuration files and ALL THE DATA
|
|
|
|
|
|
|
|
- hosts:
|
|
|
|
- mons
|
|
|
|
- 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:
|
|
|
|
|
|
|
|
- name: Purge Ceph
|
2014-04-18 16:55:31 +08:00
|
|
|
command: ceph-deploy purge {{ ansible_fqdn }}
|
2014-04-11 22:34:33 +08:00
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
|
|
|
|
- name: Remove OSD data
|
|
|
|
shell: rm -rf /var/lib/ceph/osd/*/*
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: Purge remaining data
|
2014-04-18 16:55:31 +08:00
|
|
|
command: ceph-deploy purgedata {{ ansible_fqdn }}
|
2014-04-11 22:34:33 +08:00
|
|
|
delegate_to: 127.0.0.1
|
|
|
|
|
|
|
|
- name: Purge partitions
|
|
|
|
shell: parted -s {{ item[0] }} rm {{ item[1] }}
|
|
|
|
with_nested:
|
|
|
|
- devices
|
2014-08-14 20:08:52 +08:00
|
|
|
- partitions
|
2014-04-11 22:34:33 +08:00
|
|
|
ignore_errors: true
|