osd: Fix number of OSD calculation

If some OSDs are to be created and others already exist the calculation
only counted the to be created OSDs. This changes the calculation to
take all OSDs into account.

Signed-off-by: Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>
(cherry picked from commit 15044da030)
pull/6009/head
Gaudenz Steinlin 2019-08-27 15:15:35 +02:00 committed by Dimitri Savineau
parent 0cb9e179f5
commit 44d43a8e4d
1 changed files with 2 additions and 4 deletions

View File

@ -80,14 +80,12 @@
changed_when: false changed_when: false
when: when:
- devices | default([]) | length > 0 - devices | default([]) | length > 0
- not (lvm_batch_report.stdout | default('{}') | from_json).changed | default(false) | bool
- name: set_fact num_osds from the output of 'ceph-volume lvm list' - name: set_fact num_osds (add existing osds)
set_fact: set_fact:
num_osds: "{{ lvm_list.stdout | default('{}') | from_json | length | int }}" num_osds: "{{ lvm_list.stdout | default('{}') | from_json | length | int + num_osds | default(0) | int }}"
when: when:
- devices | default([]) | length > 0 - devices | default([]) | length > 0
- not (lvm_batch_report.stdout | default('{}') | from_json).changed | default(false) | bool
- name: create ceph conf directory - name: create ceph conf directory
file: file: