diff --git a/roles/backend_setup/tasks/get_vg_groupings.yml b/roles/backend_setup/tasks/get_vg_groupings.yml index b0e03ce..c8ae589 100644 --- a/roles/backend_setup/tasks/get_vg_groupings.yml +++ b/roles/backend_setup/tasks/get_vg_groupings.yml @@ -5,7 +5,7 @@ gluster_volumes_by_groupname_pre: >- {%- set output={} -%} {%- for grouper, devicesConf in volume_groups | groupby('vgname') -%} - {%- set confs=[] -%} + {%- set confs=[] -%} {%- for deviceConf in devicesConf -%} {%- if deviceConf.pvname is defined -%} {%- for device in deviceConf.pvname.split(',') -%} @@ -15,7 +15,7 @@ {%- endfor -%} {%- endif -%} {%- endfor -%} - {{- output.__setitem__(grouper, confs) -}} + {{- output.__setitem__(grouper, confs) -}} {%- endfor -%} {%- if hostvars[inventory_hostname].ansible_lvm is defined and hostvars[inventory_hostname].ansible_lvm.pvs is defined -%} {%- for device, pvs in hostvars[inventory_hostname].ansible_lvm.pvs.items() -%} @@ -24,7 +24,7 @@ {%- endif -%} {%- endfor -%} {%- endif -%} - {{- output | to_json -}} + {{- output -}} - name: Check if vg block device exists shell: > @@ -51,4 +51,4 @@ {{- output.__setitem__(vgname, confs) -}} {%- endfor -%} {%- endfor -%} - {{- output | to_json -}} + {{- output -}} diff --git a/roles/backend_setup/tasks/thick_lv_create.yml b/roles/backend_setup/tasks/thick_lv_create.yml index 45a63e0..77a4f01 100644 --- a/roles/backend_setup/tasks/thick_lv_create.yml +++ b/roles/backend_setup/tasks/thick_lv_create.yml @@ -31,7 +31,7 @@ {{- output.append({"vgname": cnf.vgname, "raid": cnf.raid | default() , "pvname": (cnf.pvs|default('')).split(',') | select | list | unique | join(',')}) -}} {%- endif -%} {%- endfor -%} - {{- output | to_json -}} + {{- output -}} when: gluster_infra_thick_lvs is defined and gluster_infra_thick_lvs is not none and gluster_infra_thick_lvs|length >0 - name: Make sure thick pvs exists in volume group @@ -129,4 +129,3 @@ loop_control: index_var: index when: item is not none and lv_device_exists.results[index].stdout_lines is defined and "0" not in lv_device_exists.results[index].stdout_lines - diff --git a/roles/backend_setup/tasks/thin_pool_create.yml b/roles/backend_setup/tasks/thin_pool_create.yml index 1d3d6f6..1f7b1ee 100644 --- a/roles/backend_setup/tasks/thin_pool_create.yml +++ b/roles/backend_setup/tasks/thin_pool_create.yml @@ -68,7 +68,7 @@ {{- output.append({"vgname": cnf.vgname, "pvname": (cnf.pvs|default('') ~ ',' ~ (cnf.meta_pvs|default(''))).split(',') | select | list | unique | join(',')}) -}} {%- endif -%} {%- endfor -%} - {{- output | to_json -}} + {{- output -}} when: gluster_infra_thinpools is defined and gluster_infra_thinpools is not none and gluster_infra_thinpools|length >0 # https://github.com/ansible/ansible/issues/13262 @@ -298,4 +298,3 @@ # --zero n" with_items: "{{ gluster_infra_thinpools }}" when: gluster_infra_thinpools is defined and item.raid is not defined - diff --git a/roles/backend_setup/tasks/thin_volume_create.yml b/roles/backend_setup/tasks/thin_volume_create.yml index 008d590..7986464 100644 --- a/roles/backend_setup/tasks/thin_volume_create.yml +++ b/roles/backend_setup/tasks/thin_volume_create.yml @@ -49,7 +49,7 @@ {{- output.append({"vgname": cnf.vgname, "pvname": (cnf.pvs|default('') ~ ',' ~ (cnf.meta_pvs|default(''))).split(',') | select | list | unique | join(',')}) -}} {%- endif -%} {%- endfor -%} - {{- output | to_json -}} + {{- output -}} when: gluster_infra_lv_logicalvols is defined and gluster_infra_lv_logicalvols is not none and gluster_infra_lv_logicalvols|length >0 @@ -151,4 +151,3 @@ gluster_infra_lv_logicalvols is defined and gluster_infra_lv_logicalvols is not none and gluster_infra_lv_logicalvols|length >0 and item is defined and item is not none and lvt_device_exists.results[index].stdout_lines is defined and "0" not in lvt_device_exists.results[index].stdout_lines and ((item.opts is not defined or "raid" not in item.opts) and item.meta_pvs is not defined and item.meta_opts is not defined) -