-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrhhi-cleanup.yml
42 lines (34 loc) · 1.25 KB
/
rhhi-cleanup.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
---
- hosts: rhhi-storage
gather_facts: no
ignore_errors: yes
tasks:
- name: "Stop the Gluster volume"
gluster_volume: name={{ item }} state=stopped
run_once: yes
with_items: [ engine, vmstore, data ]
- name: "Delete the Gluster volume"
gluster_volume: name={{ item }} state=absent
run_once: yes
with_items: [ engine, vmstore, data ]
- name: "Remove brick_dirs"
file: path=/gluster_bricks/{{ item }}/{{ item }}/ state=absent
with_items: [ engine, vmstore, data ]
- name: "Unmount the bricks"
mount: path=/gluster_bricks/{{ item }} state=absent
with_items: [ engine, vmstore, data ]
- name: "Dissolve the Trusted Storage Pool"
command: gluster peer detach {{ item }}
with_items: [ 192.168.2.1, 192.168.2.2, 192.168.2.3, rhhi1-gluster, rhhi2-gluster, rhhi3-gluster ]
- name: "Remove the VGs"
command: vgremove {{ item }} --force
with_items: [ gluster_vg_vdb, gluster_vg_vdc ]
- name: "Remove the PVs"
command: pvremove /dev/{{ item }} --force
with_items: [ vdb, vdc ]
- name: "Wipe the drives"
command: wipefs -af /dev/{{ item }}
with_items: [ vdb, vdc ]
- name: "Clean disks the hard way"
command: dd if=/dev/zero of=/dev/{{ item }} bs=1M count=10
with_items: [ vdb, vdc ]