mirror of https://github.com/ceph/ceph-ansible.git
common: fix py2 pool_list from_json when skipped
When using python 2 and the task with a loop is skipped then it generates
an error.
Unexpected templating type error occurred on
({{ (pool_list.stdout | from_json)['pools'] }}): expected string or buffer
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit cf6e33346e
)
pull/6738/head
parent
f7882bbc02
commit
17b9ff03d2
|
@ -399,7 +399,7 @@
|
|||
set_fact:
|
||||
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}"
|
||||
run_once: true
|
||||
with_items: "{{ (pool_list.stdout | from_json)['pools'] }}"
|
||||
with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}"
|
||||
|
||||
- name: disable balancer
|
||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"
|
||||
|
|
|
@ -230,7 +230,7 @@
|
|||
set_fact:
|
||||
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}"
|
||||
run_once: true
|
||||
with_items: "{{ (pool_list.stdout | from_json)['pools'] }}"
|
||||
with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}"
|
||||
|
||||
- name: disable balancer
|
||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
set_fact:
|
||||
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}"
|
||||
run_once: true
|
||||
with_items: "{{ (pool_list.stdout | from_json)['pools'] }}"
|
||||
with_items: "{{ (pool_list.stdout | default('{}') | from_json)['pools'] }}"
|
||||
|
||||
- name: disable balancer
|
||||
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"
|
||||
|
|
Loading…
Reference in New Issue