--- - name: Get list of existing gluster volumes shell: "gluster volume info" changed_when: false register: gv_results - name: Configure volumes include_tasks: create_volume.yml with_dict: "{{ domain.volumes }}" when: volume_string not in gv_results.stdout_lines vars: volume_string: "Volume Name: {{ volume.key }}" domain_servers: "{{ groups[domain.servers] | map('extract', hostvars, 'ands_storage_hostname') | list }}" loop_control: loop_var: volume