summaryrefslogtreecommitdiffstats
path: root/roles/glusterfs/tasks/create_block.yml
blob: 5b30f02ccb0c83c2540b66fb35fc8aa694d01ee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- name: Check if the holding volume already exists
  shell: "gluster volume info {{ block.value.volume }}"
  changed_when: false
  register: gv_results

- name: Get list of existing block volumes
  shell: "gluster-block list {{ block.value.volume }}"
  changed_when: false
  register: bv_results

- name: Create block volume
  shell: "gluster-block create {{ block.value.volume }}/{{ block.key }} ha {{ servers | length }} auth disable prealloc no {{ servers | join(',') }} {{ block.value.capacity }}"
  when: block.key not in bv_results.stdout_lines
  vars:
    ha: "{{ block.value.ha | default(3) }}"
    servers: "{{ domain_servers[0:(ha | int)] }}"
  loop_control:
    loop_var: volume