From: Gaudenz Steinlin Date: Tue, 27 Aug 2019 13:15:35 +0000 (+0200) Subject: osd: Fix number of OSD calculation X-Git-Tag: v5.0.3~30 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=44d43a8e4d58cc33bb34b43a395ce007fdc12b92;p=ceph-ansible.git 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 (cherry picked from commit 15044da03052fcb4a3c45f344f41e06b0d418e4d) --- diff --git a/roles/ceph-config/tasks/main.yml b/roles/ceph-config/tasks/main.yml index f831ab236..ef16fc317 100644 --- a/roles/ceph-config/tasks/main.yml +++ b/roles/ceph-config/tasks/main.yml @@ -80,14 +80,12 @@ changed_when: false when: - 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: - 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: - devices | default([]) | length > 0 - - not (lvm_batch_report.stdout | default('{}') | from_json).changed | default(false) | bool - name: create ceph conf directory file: