]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-rgw: Work around Jinja2 < 2.8 missng eq test
authorBenoît Knecht <bknecht@protonmail.ch>
Wed, 4 Aug 2021 13:12:37 +0000 (15:12 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 11 Aug 2021 11:53:44 +0000 (13:53 +0200)
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 <bknecht@protonmail.ch>
roles/ceph-rgw/tasks/rgw_create_pools.yml

index 207c14199f3500471c2f0c093847f79b9e1466f3..d2e900b0be2f084aaacee74143ba6d047cd909f4 100644 (file)
@@ -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 }}"
   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