From 6ff633723067ecfa3644645e7cf8fd2216be616a Mon Sep 17 00:00:00 2001 From: Andrei Nistor Date: Mon, 25 Nov 2019 15:27:56 +0000 Subject: [PATCH] Fix 'nova_cephx_raw_key' is undefined When using external ceph without nova integration, kolla-ansible fails because 'nova_cephx_raw_key' is undefined. This patch fixes the issue by applying the 'default' filter to prevent failure on undefined. The change in behavior was introduced by [1]. [1] https://review.opendev.org/689753 commit 44709f413246a05b891f250e88c43226e1f1b0c9 Change-Id: I2fdca1a6a78e78623733a387a2d8c7e29d449083 Closes-Bug: #1853862 Co-Authored-By: Mark Goddard --- ansible/roles/nova-cell/tasks/external_ceph.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ansible/roles/nova-cell/tasks/external_ceph.yml b/ansible/roles/nova-cell/tasks/external_ceph.yml index 4587452a61..81bbfd8df2 100644 --- a/ansible/roles/nova-cell/tasks/external_ceph.yml +++ b/ansible/roles/nova-cell/tasks/external_ceph.yml @@ -111,11 +111,13 @@ - item.enabled | bool - external_ceph_cephx_enabled | bool with_items: + # NOTE(yoctozepto): 'default' filter required due to eager evaluation of item content + # which will be undefined if the applicable condition is False - uuid: "{{ rbd_secret_uuid }}" - result: "{{ nova_cephx_raw_key }}" + result: "{{ nova_cephx_raw_key | default }}" enabled: "{{ nova_backend == 'rbd' }}" - uuid: "{{ cinder_rbd_secret_uuid }}" - result: "{{ cinder_cephx_raw_key }}" + result: "{{ cinder_cephx_raw_key | default }}" enabled: "{{ cinder_backend_ceph }}" notify: - Restart nova-libvirt container