mirror of https://github.com/ceph/ceph-ansible.git
ceph-config: fix ceph-volume lvm batch report
Since the major ceph-volume lvm batch refactoring, the report value
is different.
Before the refact, the report was a dict with the OSDs list to be created
under the "osds" key.
After the refact, the report is a list of dict.
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 827b23353f
)
pull/6062/head
parent
3f16132e44
commit
24a5b1bbb5
|
@ -58,16 +58,23 @@
|
||||||
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
||||||
PYTHONIOENCODING: utf-8
|
PYTHONIOENCODING: utf-8
|
||||||
when: _devices | default([]) | length > 0
|
when: _devices | default([]) | length > 0
|
||||||
when:
|
|
||||||
- devices | default([]) | length > 0
|
|
||||||
|
|
||||||
- name: set_fact num_osds from the output of 'ceph-volume lvm batch --report'
|
- name: set_fact num_osds from the output of 'ceph-volume lvm batch --report' (legacy report)
|
||||||
set_fact:
|
set_fact:
|
||||||
num_osds: "{{ ((lvm_batch_report.stdout | default('{}') | from_json).osds | default([]) | length | int) + (_rejected_devices | default([]) | length | int) }}"
|
num_osds: "{{ ((lvm_batch_report.stdout | default('{}') | from_json).osds | default([]) | length | int) + (_rejected_devices | default([]) | length | int) }}"
|
||||||
when:
|
when:
|
||||||
- devices | default([]) | length > 0
|
- (lvm_batch_report.stdout | default('{}') | from_json) is mapping
|
||||||
- (lvm_batch_report.stdout | default('{}') | from_json).changed | default(true) | bool
|
- (lvm_batch_report.stdout | default('{}') | from_json).changed | default(true) | bool
|
||||||
|
|
||||||
|
- name: set_fact num_osds from the output of 'ceph-volume lvm batch --report' (new report)
|
||||||
|
set_fact:
|
||||||
|
num_osds: "{{ ((lvm_batch_report.stdout | default('{}') | from_json) | default([]) | length | int) + (_rejected_devices | default([]) | length | int) }}"
|
||||||
|
when:
|
||||||
|
- (lvm_batch_report.stdout | default('{}') | from_json) is not mapping
|
||||||
|
- (lvm_batch_report.stdout | default('{}') | from_json).changed | default(true) | bool
|
||||||
|
when:
|
||||||
|
- devices | default([]) | length > 0
|
||||||
|
|
||||||
- name: run 'ceph-volume lvm list' to see how many osds have already been created
|
- name: run 'ceph-volume lvm list' to see how many osds have already been created
|
||||||
ceph_volume:
|
ceph_volume:
|
||||||
action: "list"
|
action: "list"
|
||||||
|
|
Loading…
Reference in New Issue