]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
1 | --- |
2 | ||
3 | - hosts: osds | |
4 | become: yes | |
5 | tasks: | |
6 | ||
7 | - name: list all OSD directories | |
8 | find: | |
9 | paths: /var/lib/ceph/osd | |
10 | file_type: directory | |
11 | register: osd_paths | |
12 | ||
13 | - name: scan all OSD directories | |
14 | command: "ceph-volume --cluster={{ cluster }} simple scan {{ item.path }}" | |
15 | environment: | |
16 | CEPH_VOLUME_DEBUG: 1 | |
17 | with_items: | |
18 | - "{{ osd_paths.files }}" | |
19 | ||
20 | - name: list all OSD JSON files | |
21 | find: | |
22 | paths: /etc/ceph/osd | |
23 | file_type: file | |
24 | register: osd_configs | |
25 | ||
26 | - name: activate all scanned OSDs | |
27 | command: "ceph-volume --cluster={{ cluster }} simple activate --file {{ item.path }}" | |
28 | environment: | |
29 | CEPH_VOLUME_DEBUG: 1 | |
30 | with_items: | |
31 | - "{{ osd_configs.files }}" | |
11fdf7f2 TL |
32 | |
33 | # zap tests | |
34 | ||
35 | - hosts: osds | |
36 | become: yes | |
37 | tasks: | |
38 | ||
39 | - name: stop ceph-osd daemons | |
40 | service: | |
41 | name: "ceph-osd@{{ item }}" | |
42 | state: stopped | |
43 | with_items: | |
44 | - "0" | |
45 | - "1" | |
46 | ||
47 | ||
48 | - hosts: mons | |
49 | become: yes | |
50 | tasks: | |
51 | ||
52 | - name: purge osds | |
53 | command: "ceph --cluster {{ cluster }} osd purge osd.{{ item }} --yes-i-really-mean-it" | |
54 | with_items: | |
55 | - "0" | |
56 | - "1" | |
57 | ||
58 | ||
59 | - hosts: osds | |
60 | become: yes | |
61 | tasks: | |
62 | ||
63 | - name: zap devices used for OSDs | |
64 | command: "ceph-volume --cluster {{ cluster }} lvm zap --osd-id {{ item }} --destroy" | |
65 | with_items: | |
66 | - "0" | |
67 | - "1" | |
68 | environment: | |
69 | CEPH_VOLUME_DEBUG: 1 | |
70 |