summaryrefslogtreecommitdiffstats
path: root/roles/glusterfs/tasks/create_domain.yml
blob: 99f9959a5387db394c07dff8f37177ac934ef160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
- 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

- name: Create block volumes
  include_tasks: create_block.yml
  when: block.value.volume in domain.volumes.keys()
  with_dict: "{{ glusterfs_block_volumes }}"
  vars:
    domain_servers: "{{ groups[domain.servers] | map('extract', hostvars, 'ands_storage_hostname') | list }}"
  loop_control:
    loop_var: block