diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-03-18 22:59:31 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-03-18 22:59:31 +0100 |
commit | 47f350bc3aa85a8bd406d95faf084df2abf74ae9 (patch) | |
tree | 72ad1e91bac46d3457f89781dc90f0d6c1c074d5 /roles/glusterfs/tasks/create_block.yml | |
parent | 006f333828db373435daa15483d2ab753048f62a (diff) | |
download | ands-47f350bc3aa85a8bd406d95faf084df2abf74ae9.tar.gz ands-47f350bc3aa85a8bd406d95faf084df2abf74ae9.tar.bz2 ands-47f350bc3aa85a8bd406d95faf084df2abf74ae9.tar.xz ands-47f350bc3aa85a8bd406d95faf084df2abf74ae9.zip |
Second revision: includes hostpath mounts, gluster block storage, kaas apps, etc.
Diffstat (limited to 'roles/glusterfs/tasks/create_block.yml')
-rw-r--r-- | roles/glusterfs/tasks/create_block.yml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/glusterfs/tasks/create_block.yml b/roles/glusterfs/tasks/create_block.yml new file mode 100644 index 0000000..5b30f02 --- /dev/null +++ b/roles/glusterfs/tasks/create_block.yml @@ -0,0 +1,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 |