From: Guillaume Abrioux Date: Fri, 12 Mar 2021 14:49:15 +0000 (+0100) Subject: config: reset num_osds X-Git-Tag: v6.0.2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d65c7b40354480ca3e25fd13c8f06dcd4779e002;p=ceph-ansible.git config: reset num_osds 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 (cherry picked from commit 31a0f2653db0a1ff57adb1249107e2e8986ac34b) --- diff --git a/roles/ceph-config/tasks/main.yml b/roles/ceph-config/tasks/main.yml index 8e7e3ff40..e22f325b0 100644 --- a/roles/ceph-config/tasks/main.yml +++ b/roles/ceph-config/tasks/main.yml @@ -14,6 +14,10 @@ # 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 }}"