mirror of https://github.com/ceph/ceph-ansible.git
devices: allow using lvm_volumes with devices
* Exclude device from lvm_volumes while osd_auto_discovery is true
* Sum num_osds on both lvm_volumes and devices list
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 80b1ed9d4a
)
pull/7414/head
parent
bd66017d46
commit
7206037c5d
|
@ -20,7 +20,7 @@
|
|||
|
||||
- name: count number of osds for lvm scenario
|
||||
set_fact:
|
||||
num_osds: "{{ lvm_volumes | length | int }}"
|
||||
num_osds: "{{ num_osds | int + (lvm_volumes | length | int) }}"
|
||||
when: lvm_volumes | default([]) | length > 0
|
||||
|
||||
- block:
|
||||
|
@ -65,14 +65,14 @@
|
|||
|
||||
- name: set_fact num_osds from the output of 'ceph-volume lvm batch --report' (legacy report)
|
||||
set_fact:
|
||||
num_osds: "{{ ((lvm_batch_report.stdout | default('{}') | from_json).osds | default([]) | length | int) + (_rejected_devices | default([]) | length | int) }}"
|
||||
num_osds: "{{ num_osds | int + ((lvm_batch_report.stdout | default('{}') | from_json).osds | default([]) | length | int) + (_rejected_devices | default([]) | length | int) }}"
|
||||
when:
|
||||
- (lvm_batch_report.stdout | default('{}') | from_json) is mapping
|
||||
- (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) }}"
|
||||
num_osds: "{{ num_osds | int + ((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
|
||||
|
|
|
@ -64,3 +64,4 @@
|
|||
- item.key is not match osd_auto_discovery_exclude
|
||||
- device not in dedicated_devices | default([])
|
||||
- device not in bluestore_wal_devices | default([])
|
||||
- device not in (lvm_volumes | default([]) | map(attribute='data') | list)
|
||||
|
|
Loading…
Reference in New Issue