From 5137bc263a2166f2e8966480e6459e79ade12dd0 Mon Sep 17 00:00:00 2001 From: Konstantin Shalygin Date: Sat, 9 Jun 2018 01:03:00 +0700 Subject: [PATCH] ceph-osd: set 'openstack_keys_tmp' only when 'openstack_config' is defined. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If 'openstack_config' is false this task shouldn't be executed. Signed-off-by: Konstantin Shalygin (cherry picked from commit 3a07568496f718ffe44077eac23d7397a17b3b09) Signed-off-by: Sébastien Han --- roles/ceph-osd/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/ceph-osd/tasks/main.yml b/roles/ceph-osd/tasks/main.yml index 197a4b7cf..11b3e18c6 100644 --- a/roles/ceph-osd/tasks/main.yml +++ b/roles/ceph-osd/tasks/main.yml @@ -89,6 +89,7 @@ openstack_keys_tmp: "{{ openstack_keys_tmp|default([]) + [ { 'key': item.key, 'name': item.name, 'caps': { 'mon': item.mon_cap, 'osd': item.osd_cap|default(''), 'mds': item.mds_cap|default(''), 'mgr': item.mgr_cap|default('') } , 'mode': item.mode } ] }}" with_items: "{{ openstack_keys }}" when: + - openstack_config - item.get('mon_cap', None) # it's enough to assume we are running an old-fashionned syntax simply by checking the presence of mon_cap since every key needs this cap - name: set_fact keys - override keys_tmp with keys