diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index f2c8ef65c..1ed417c6e 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -359,6 +359,12 @@ 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 }} @@ -369,6 +375,12 @@ 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: diff --git a/roles/ceph-config/tasks/main.yml b/roles/ceph-config/tasks/main.yml index dd9200e62..d1763799c 100644 --- a/roles/ceph-config/tasks/main.yml +++ b/roles/ceph-config/tasks/main.yml @@ -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: