diff --git a/roles/ceph-config/tasks/main.yml b/roles/ceph-config/tasks/main.yml index 9ebac6c49..d5fe72adc 100644 --- a/roles/ceph-config/tasks/main.yml +++ b/roles/ceph-config/tasks/main.yml @@ -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 diff --git a/roles/ceph-facts/tasks/devices.yml b/roles/ceph-facts/tasks/devices.yml index f981ced91..a66fafd9f 100644 --- a/roles/ceph-facts/tasks/devices.yml +++ b/roles/ceph-facts/tasks/devices.yml @@ -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)