]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-config: exclude already counted osds by lvm_volumes
authorSeena Fallah <seenafallah@gmail.com>
Sun, 26 Feb 2023 14:11:26 +0000 (15:11 +0100)
committerTeoman ONAY <tonay@redhat.com>
Fri, 17 Mar 2023 15:05:34 +0000 (16:05 +0100)
Exclude lvm_volumes defined disks from existing osds while it has been counted by the "count number of osds for lvm scenario" task.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
roles/ceph-config/tasks/main.yml

index dc7e0de01e3d552aed45ea56ca0d094930850662..cd25b0a20a09ec8e086016feed5e189173b6a07b 100644 (file)
@@ -91,7 +91,7 @@
 
     - name: set_fact num_osds (add existing osds)
       set_fact:
-        num_osds: "{{ lvm_list.stdout | default('{}') | from_json | length | int + num_osds | default(0) | int }}"
+        num_osds: "{{ num_osds | int + (lvm_list.stdout | default('{}') | from_json | dict2items | map(attribute='value') | flatten | map(attribute='devices') | sum(start=[]) | difference(lvm_volumes | default([]) | map(attribute='data')) | length | int) }}"
 
 - name: set osd related config facts
   when: inventory_hostname in groups.get(osd_group_name, [])