]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
config: reset num_osds
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 12 Mar 2021 14:49:15 +0000 (15:49 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 15 Mar 2021 09:41:28 +0000 (10:41 +0100)
When collocating OSDs with other daemon, `num_osds` is incorrectly calculated
because `ceph-config` is called multiple times.

Indeed, the following code:
```
num_osds: "{{ lvm_list.stdout | default('{}') | from_json | length | int + num_osds | default(0) | int }}"
```

makes `num_osds` be incremented each time `ceph-config` is called.

We have to reset it in order to get the correct number of expected OSDs.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-config/tasks/main.yml

index 8e7e3ff40341711cd9c1a9c0313867633890c4cd..e22f325b092029b75b469f7ed6447d4bc8466b43 100644 (file)
     # running osds
     - not rolling_update | bool
   block:
+  - name: reset num_osds
+    set_fact:
+      num_osds: 0
+
   - name: count number of osds for lvm scenario
     set_fact:
       num_osds: "{{ lvm_volumes | length | int }}"