]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
devices: allow using lvm_volumes with devices
authorSeena Fallah <seenafallah@gmail.com>
Sun, 26 Feb 2023 14:08:09 +0000 (15:08 +0100)
committerTeoman ONAY <tonay@redhat.com>
Fri, 17 Mar 2023 15:05:34 +0000 (16:05 +0100)
* Exclude device from lvm_volumes while osd_auto_discovery is true
* Sum num_osds on both lvm_volumes and devices list

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

index a25953e10e7f2e1375e365c6a5d8f280a529015e..dc7e0de01e3d552aed45ea56ca0d094930850662 100644 (file)
@@ -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:
 
         - 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
index f981ced91ebd78dd0f1d6f31daedc388d4bd8af4..a66fafd9f004f42deb4ad871f4a2e27c82e780c0 100644 (file)
@@ -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)