Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing to_json because before ansible v2.13 its returning dictionar… #136

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions roles/backend_setup/tasks/get_vg_groupings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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(',') -%}
Expand All @@ -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() -%}
Expand All @@ -24,7 +24,7 @@
{%- endif -%}
{%- endfor -%}
{%- endif -%}
{{- output | to_json -}}
{{- output -}}

- name: Check if vg block device exists
shell: >
Expand All @@ -51,4 +51,4 @@
{{- output.__setitem__(vgname, confs) -}}
{%- endfor -%}
{%- endfor -%}
{{- output | to_json -}}
{{- output -}}
3 changes: 1 addition & 2 deletions roles/backend_setup/tasks/thick_lv_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

3 changes: 1 addition & 2 deletions roles/backend_setup/tasks/thin_pool_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -298,4 +298,3 @@
# --zero n"
with_items: "{{ gluster_infra_thinpools }}"
when: gluster_infra_thinpools is defined and item.raid is not defined

3 changes: 1 addition & 2 deletions roles/backend_setup/tasks/thin_volume_create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)