From cfddd2903cb40c1bab606af7fc7b3a739b42049b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 29 Aug 2017 00:16:31 +0200 Subject: [PATCH] ceph-docker-common: fix empty array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The list can not be evaluated properly if it containers '[]', which is the case when using the filter "default([])". To fix this, we have to properly merge the lists. This is fixing the issue: "list object has no element 1" Signed-off-by: Sébastien Han --- .../ceph-docker-common/tasks/fetch_configs.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/roles/ceph-docker-common/tasks/fetch_configs.yml b/roles/ceph-docker-common/tasks/fetch_configs.yml index 03fa62ed0..d36178274 100644 --- a/roles/ceph-docker-common/tasks/fetch_configs.yml +++ b/roles/ceph-docker-common/tasks/fetch_configs.yml @@ -1,9 +1,4 @@ --- -- name: register rbd bootstrap key - set_fact: - bootstrap_rbd_keyring: "/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring" - when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous - - name: set config and keys paths set_fact: ceph_config_keys: @@ -13,7 +8,17 @@ - /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring - /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring - /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring - - "{{ bootstrap_rbd_keyring | default([]) }}" + +- name: register rbd bootstrap key + set_fact: + bootstrap_rbd_keyring: + - "/var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring" + when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous + +- name: merge rbd bootstrap key to config and keys paths + set_fact: + ceph_config_keys: "{{ ceph_config_keys + bootstrap_rbd_keyring }}" + when: ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous - name: add mgr keys to config and keys paths set_fact: