6 - name: stop ceph-osd@2 daemon
11 - name: stop ceph-osd@0 daemon
22 command: "ceph --cluster {{ cluster }} osd destroy osd.2 --yes-i-really-mean-it"
25 command: "ceph --cluster {{ cluster }} osd destroy osd.0 --yes-i-really-mean-it"
34 command: "ceph-volume --cluster {{ cluster }} lvm zap /dev/sdd1 --destroy"
38 # partitions have been completely removed, so re-create them again
39 - name: re-create partition /dev/sdd for lvm data usage
49 - name: redeploy osd.2 using /dev/sdd1
50 command: "ceph-volume --cluster {{ cluster }} lvm create --bluestore --data /dev/sdd1 --osd-id 2"
54 # osd.0 device (zap without --destroy that removes the LV)
55 - name: zap test_group/data-lv1
56 command: "ceph-volume --cluster {{ cluster }} lvm zap test_group/data-lv1"
60 - name: prepare osd.0 again using test_group/data-lv1
61 command: "ceph-volume --cluster {{ cluster }} lvm prepare --bluestore --data test_group/data-lv1 --osd-id 0"
65 - name: find all OSD directories
67 paths: /var/lib/ceph/osd
70 register: osd_directories
72 - name: find all OSD symlinks
74 paths: /var/lib/ceph/osd
78 register: osd_symlinks
80 # set the OSD dir and the block/block.db links to root:root permissions, to
81 # ensure that the OSD will be able to activate regardless
83 path: "{{ item.path }}"
87 - "{{ osd_directories.files }}"
90 path: "{{ item.path }}"
94 - "{{ osd_symlinks.files }}"
96 - name: activate all to start the previously prepared osd.0
97 command: "ceph-volume lvm activate --all"
101 - name: node inventory
102 command: "ceph-volume inventory"
106 - name: list all OSDs
107 command: "ceph-volume lvm list"
111 - name: create temporary directory
117 - name: create a 5GB sparse file
118 command: fallocate -l 5G {{ tmpdir.path }}/sparse.file
120 - name: find an empty loop device
122 register: losetup_list
124 - name: setup loop device with sparse file
125 command: losetup {{ losetup_list.stdout }} {{ tmpdir.path }}/sparse.file
127 - name: create volume group
128 command: vgcreate test_zap {{ losetup_list.stdout }}
131 - name: create logical volume 1
132 command: lvcreate --yes -l 50%FREE -n data-lv1 test_zap
135 - name: create logical volume 2
136 command: lvcreate --yes -l 50%FREE -n data-lv2 test_zap
139 # zapping the first lv shouldn't remove the vg, allowing the second zap to succeed
140 - name: zap test_zap/data-lv1
141 command: "ceph-volume --cluster {{ cluster }} lvm zap --destroy test_zap/data-lv1"
145 - name: zap test_zap/data-lv2
146 command: "ceph-volume --cluster {{ cluster }} lvm zap --destroy test_zap/data-lv2"