From a8346af4f7ea1feb01e60fa238ce1bb7b8d79678 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Knecht?= Date: Wed, 4 Aug 2021 15:12:37 +0200 Subject: [PATCH] ceph-rgw: Work around Jinja2 < 2.8 missng eq test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit EL7 ships with Jinja2 version 2.7, which is missing the `eq` test. Work around this by using `match` instead. Signed-off-by: Benoît Knecht --- roles/ceph-rgw/tasks/rgw_create_pools.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ceph-rgw/tasks/rgw_create_pools.yml b/roles/ceph-rgw/tasks/rgw_create_pools.yml index 207c14199..d2e900b0b 100644 --- a/roles/ceph-rgw/tasks/rgw_create_pools.yml +++ b/roles/ceph-rgw/tasks/rgw_create_pools.yml @@ -96,7 +96,7 @@ loop: "{{ rgw_create_pools | dict2items }}" delegate_to: "{{ groups[mon_group_name][0] }}" when: > - 'rgw' not in (rgw_osd_pool_ls_detail | selectattr('pool_name', 'eq', item.key) | first).application_metadata + 'rgw' not in (rgw_osd_pool_ls_detail | selectattr('pool_name', 'match', '^'+item.key+'$') | first).application_metadata - name: set pool pg_num command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd pool set {{ item.key }} pg_num {{ item.value.pg_num }}" @@ -108,4 +108,4 @@ delegate_to: "{{ groups[mon_group_name][0] }}" when: - item.value.pg_num is defined - - (rgw_osd_pool_ls_detail | selectattr('pool_name', 'eq', item.key) | first).pg_num != item.value.pg_num + - (rgw_osd_pool_ls_detail | selectattr('pool_name', 'match', '^'+item.key+'$') | first).pg_num != item.value.pg_num -- 2.39.5