]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/functional/batch/playbooks/test_explicit.yml
Import ceph 15.2.8
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / functional / batch / playbooks / test_explicit.yml
1
2 - hosts: osds
3 become: yes
4 tasks:
5
6 - name: stop ceph-osd daemons
7 service:
8 name: "ceph-osd@{{ item }}"
9 state: stopped
10 with_items: "{{ osd_ids }}"
11
12 - hosts: mons
13 become: yes
14 tasks:
15
16 - name: mark osds down
17 command: "ceph --cluster {{ cluster }} osd down osd.{{ item }}"
18 with_items: "{{ osd_ids }}"
19 - name: purge osds
20 command: "ceph --cluster {{ cluster }} osd purge osd.{{ item }} --yes-i-really-mean-it"
21 with_items: "{{ osd_ids }}"
22
23 - hosts: osds
24 become: yes
25 vars:
26 external_devices: "{{ '--db-devices' if osd_objectstore == 'bluestore' else '--journal-devices' }}"
27 tasks:
28
29 - name: zap devices used for OSDs
30 command: "ceph-volume --cluster {{ cluster }} lvm zap {{ item }} --destroy"
31 with_items: "{{ devices }}"
32 environment:
33 CEPH_VOLUME_DEBUG: 1
34
35 - name: batch create devices again
36 command: "ceph-volume --cluster {{ cluster }} lvm batch --yes --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices[:2] | join(' ') }} {{ external_devices }} {{ devices[2:] | join(' ') }}"
37 environment:
38 CEPH_VOLUME_DEBUG: 1
39
40 - name: ensure batch create is idempotent when all data devices are filtered
41 command: "ceph-volume --cluster {{ cluster }} lvm batch --yes --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices[:2] | join(' ') }} {{ external_devices }} {{ devices[2:] | join(' ') }}"
42 register: batch_cmd
43 failed_when: false
44 environment:
45 CEPH_VOLUME_DEBUG: 1
46
47 - name: check batch idempotency
48 fail:
49 msg: "lvm batch failed idempotency check"
50 when:
51 - batch_cmd.rc != 0
52
53 - name: run batch --report to see if devices get filtered
54 command: "ceph-volume --cluster {{ cluster }} lvm batch --report --format=json --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices[:2] | join(' ') }} {{ external_devices }} {{ devices[2:] | join(' ') }}"
55 register: report_cmd
56 failed_when: false
57 environment:
58 CEPH_VOLUME_DEBUG: 1
59
60 - name: check batch --report idempotency
61 fail:
62 msg: "lvm batch --report failed idempotency check"
63 when:
64 - report_cmd.rc != 0