forked from ceph/ceph-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
purge-cluster.yml
43 lines (32 loc) · 922 Bytes
/
purge-cluster.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
# 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_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' ]
tasks:
- name: disk zap
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
with_items: devices
failed_when: false
- name: disk zap again
command: /usr/sbin/sgdisk --zap-all --clear --mbrtogpt -g -- {{ item }}
with_items: devices
failed_when: false
- name: call partprobe
command: partprobe