ceph-rgw: Work around Jinja2 < 2.8 missng eq test

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>
pull/6820/head
Benoît Knecht 2021-08-04 15:12:37 +02:00 committed by Guillaume Abrioux
parent 66426e1316
commit a8346af4f7
1 changed files with 2 additions and 2 deletions

View File

@ -96,7 +96,7 @@
loop: "{{ rgw_create_pools | dict2items }}" loop: "{{ rgw_create_pools | dict2items }}"
delegate_to: "{{ groups[mon_group_name][0] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
when: > 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 - 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 }}" 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] }}" delegate_to: "{{ groups[mon_group_name][0] }}"
when: when:
- item.value.pg_num is defined - 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