]> git.proxmox.com Git - ceph.git/blame - ceph/src/ceph-volume/ceph_volume/tests/functional/batch/playbooks/test.yml
import 15.2.0 Octopus source
[ceph.git] / ceph / src / ceph-volume / ceph_volume / tests / functional / batch / playbooks / test.yml
CommitLineData
91327a77
AA
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
91327a77
AA
12- hosts: mons
13 become: yes
14 tasks:
15
9f95a23c
TL
16 - name: mark osds down
17 command: "ceph --cluster {{ cluster }} osd down osd.{{ item }}"
18 with_items: "{{ osd_ids }}"
91327a77
AA
19 - name: purge osds
20 command: "ceph --cluster {{ cluster }} osd purge osd.{{ item }} --yes-i-really-mean-it"
21 with_items: "{{ osd_ids }}"
22
91327a77
AA
23- hosts: osds
24 become: yes
25 tasks:
26
27 - name: zap devices used for OSDs
28 command: "ceph-volume --cluster {{ cluster }} lvm zap {{ item }} --destroy"
29 with_items: "{{ devices }}"
30 environment:
31 CEPH_VOLUME_DEBUG: 1
32
33 - name: batch create devices again
34 command: "ceph-volume --cluster {{ cluster }} lvm batch --yes --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices | join(' ') }}"
35 environment:
36 CEPH_VOLUME_DEBUG: 1
37
38 - name: ensure batch create is idempotent
39 command: "ceph-volume --cluster {{ cluster }} lvm batch --yes --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices | join(' ') }}"
40 register: batch_cmd
41 failed_when: false
42 environment:
43 CEPH_VOLUME_DEBUG: 1
44
45 - name: check batch idempotency
46 fail:
47 msg: "lvm batch failed idempotency check"
48 when:
49 - batch_cmd.rc != 0
494da23a 50 - "'strategy changed' not in batch_cmd.stderr"
91327a77
AA
51
52 - name: run batch --report to see if devices get filtered
53 command: "ceph-volume --cluster {{ cluster }} lvm batch --report --format=json --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices | join(' ') }}"
54 register: report_cmd
55 failed_when: false
56 environment:
57 CEPH_VOLUME_DEBUG: 1
58
59 - name: check batch --report idempotency
60 fail:
61 msg: "lvm batch --report failed idempotency check"
62 when:
494da23a
TL
63 - report_cmd.rc != 0
64 - "'strategy changed' not in report_cmd.stderr"