]> git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-volume/ceph_volume/tests/functional/batch/playbooks/test_explicit.yml
import 15.2.0 Octopus source
[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
13 - hosts: mons
14 become: yes
15 tasks:
16
17 - name: mark osds down
18 command: "ceph --cluster {{ cluster }} osd down osd.{{ item }}"
19 with_items: "{{ osd_ids }}"
20 - name: purge osds
21 command: "ceph --cluster {{ cluster }} osd purge osd.{{ item }} --yes-i-really-mean-it"
22 with_items: "{{ osd_ids }}"
23
24
25 - hosts: osds
26 become: yes
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(' ') }} --db-devices {{ devices[2:] | join(' ') }}"
37 environment:
38 CEPH_VOLUME_DEBUG: 1
39
40 - name: ensure batch create is idempotent
41 command: "ceph-volume --cluster {{ cluster }} lvm batch --yes --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices[:2] | join(' ') }} --db-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 - "'strategy changed' not in batch_cmd.stderr"
53
54 - name: run batch --report to see if devices get filtered
55 command: "ceph-volume --cluster {{ cluster }} lvm batch --report --format=json --{{ osd_objectstore|default('bluestore') }} {{ '--dmcrypt' if dmcrypt|default(false) else '' }} {{ devices[:2] | join(' ') }} --db-devices {{ devices[2:] | join(' ') }}"
56 register: report_cmd
57 failed_when: false
58 environment:
59 CEPH_VOLUME_DEBUG: 1
60
61 - name: check batch --report idempotency
62 fail:
63 msg: "lvm batch --report failed idempotency check"
64 when:
65 - report_cmd.rc != 0
66 - "'strategy changed' not in report_cmd.stderr"