]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
rolling_update: set num_osds to the number of running osds
authorAndrew Schoen <aschoen@redhat.com>
Thu, 28 Mar 2019 19:34:48 +0000 (14:34 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 18 Apr 2019 08:55:11 +0000 (10:55 +0200)
We do this so that the ceph-config role can most accurately
report the number of osds for the generation of the ceph.conf
file.

We don't want to use ceph-volume to determine the number of
osds because in an upgrade to nautilus ceph-volume won't be able to
accurately count osds created by ceph-disk.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
infrastructure-playbooks/rolling_update.yml
roles/ceph-config/tasks/main.yml

index 29174b0a79d4eeaa6906660555f3e5ccbd1ec0f6..7e23e732b8c53add132d0a016e093eea2c695421 100644 (file)
       changed_when: false
       when: containerized_deployment
 
+    - name: set num_osds for container
+      set_fact:
+        num_osds: "{{ osd_names.stdout_lines|default([])|length }}"
+      when:
+        - containerized_deployment
+
     - name: stop ceph osd
       systemd:
         name: ceph-osd@{{ item }}
       when:
         - not containerized_deployment
 
+    - name: set num_osds for non container
+      set_fact:
+        num_osds: "{{ osd_ids.stdout_lines|default([])|length }}"
+      when:
+        - not containerized_deployment
+
     - import_role:
         name: ceph-defaults
     - import_role:
index 0c14d2d971b75a6c13aa4bcabcb6d0e6f888df04..05f4700ad40c58d795bc6a5b7b35aa90c50ccbca 100644 (file)
@@ -7,6 +7,9 @@
 - name: config file operations related to OSDs
   when:
     - inventory_hostname in groups.get(osd_group_name, [])
+    # the rolling_update.yml playbook sets num_osds to the number of currently
+    # running osds
+    - not rolling_update
   block:
   - name: count number of osds for lvm scenario
     set_fact: