Skip to content

Commit 39254cf

Browse files
committed
Default to empty list when generating OSD list
On a fresh cluster/node with 0 already provisioned OSDs, this will otherwise fail since _existing_ceph_osds will yield a non-iterable object.
1 parent 7a0e414 commit 39254cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tasks/ceph.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
- name: Generate a list of active OSDs
4646
ansible.builtin.set_fact:
47-
_existing_ceph_osds: "{{ _ceph_volume_data.stdout | from_json | json_query('*[].devices[]') }}"
47+
_existing_ceph_osds: "{{ _ceph_volume_data.stdout | from_json | json_query('*[].devices[]') | default([]) }}"
4848

4949
- name: Generate list of unprovisioned OSDs
5050
ansible.builtin.set_fact:

0 commit comments

Comments
 (0)