]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: Fix number of OSD calculation
authorGaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>
Tue, 27 Aug 2019 13:15:35 +0000 (15:15 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 4 Nov 2020 02:52:44 +0000 (21:52 -0500)
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 15044da03052fcb4a3c45f344f41e06b0d418e4d)

roles/ceph-config/tasks/main.yml

index 9a94a485b3e523c510734511585252c78c494e38..20fa9832c56a77fc12d4b75f3c0c6241a57948d4 100644 (file)
     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
 
 # ceph-common
 - name: config file operation for non-containerized scenarios