summaryrefslogtreecommitdiffstats
path: root/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml')
-rw-r--r--roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml51
1 files changed, 7 insertions, 44 deletions
diff --git a/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml b/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml
index baac52179..7466702b8 100644
--- a/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml
+++ b/roles/openshift_storage_glusterfs/tasks/glusterfs_registry.yml
@@ -12,7 +12,9 @@
glusterfs_block_deploy: "{{ openshift_storage_glusterfs_registry_block_deploy | bool }}"
glusterfs_block_image: "{{ openshift_storage_glusterfs_registry_block_image }}"
glusterfs_block_version: "{{ openshift_storage_glusterfs_registry_block_version }}"
- glusterfs_block_max_host_vol: "{{ openshift_storage_glusterfs_registry_block_max_host_vol }}"
+ glusterfs_block_host_vol_create: "{{ openshift_storage_glusterfs_registry_block_host_vol_create }}"
+ glusterfs_block_host_vol_size: "{{ openshift_storage_glusterfs_registry_block_host_vol_size }}"
+ glusterfs_block_host_vol_max: "{{ openshift_storage_glusterfs_registry_block_host_vol_max }}"
glusterfs_s3_deploy: "{{ openshift_storage_glusterfs_registry_s3_deploy | bool }}"
glusterfs_s3_image: "{{ openshift_storage_glusterfs_registry_s3_image }}"
glusterfs_s3_version: "{{ openshift_storage_glusterfs_registry_s3_version }}"
@@ -42,56 +44,17 @@
glusterfs_heketi_ssh_sudo: "{{ openshift_storage_glusterfs_registry_heketi_ssh_sudo | bool }}"
glusterfs_heketi_ssh_keyfile: "{{ openshift_storage_glusterfs_registry_heketi_ssh_keyfile }}"
glusterfs_heketi_fstab: "{{ openshift_storage_glusterfs_registry_heketi_fstab }}"
- glusterfs_nodes: "{{ groups.glusterfs_registry | default(groups.glusterfs) }}"
+ glusterfs_nodes: "{% if groups.glusterfs_registry is defined %}{% set nodes = groups.glusterfs_registry %}{% elif 'groups.glusterfs' is defined %}{% set nodes = groups.glusterfs %}{% else %}{% set nodes = '[]' %}{% endif %}{{ nodes }}"
-- include: glusterfs_common.yml
+- include_tasks: glusterfs_common.yml
when:
- glusterfs_nodes | default([]) | count > 0
- "'glusterfs' not in groups or glusterfs_nodes != groups.glusterfs"
-- name: Delete pre-existing GlusterFS registry resources
- oc_obj:
- namespace: "{{ glusterfs_namespace }}"
- kind: "{{ item.kind }}"
- name: "{{ item.name }}"
- state: absent
- with_items:
- - kind: "svc"
- name: "glusterfs-{{ glusterfs_name | default }}-endpoints"
- failed_when: False
-
-- name: Generate GlusterFS registry endpoints
- template:
- src: "{{ openshift.common.examples_content_version }}/glusterfs-registry-endpoints.yml.j2"
- dest: "{{ mktemp.stdout }}/glusterfs-registry-endpoints.yml"
-
-- name: Copy GlusterFS registry service
- template:
- src: "{{ openshift.common.examples_content_version }}/glusterfs-registry-service.yml.j2"
- dest: "{{ mktemp.stdout }}/glusterfs-registry-service.yml"
-
-- name: Create GlusterFS registry endpoints
- oc_obj:
- namespace: "{{ openshift.hosted.registry.namespace | default('default') }}"
- state: present
- kind: endpoints
- name: "glusterfs-{{ glusterfs_name }}-endpoints"
- files:
- - "{{ mktemp.stdout }}/glusterfs-registry-endpoints.yml"
-
-- name: Create GlusterFS registry service
- oc_obj:
- namespace: "{{ openshift.hosted.registry.namespace | default('default') }}"
- state: present
- kind: service
- name: "glusterfs-{{ glusterfs_name }}-endpoints"
- files:
- - "{{ mktemp.stdout }}/glusterfs-registry-service.yml"
-
- name: Check if GlusterFS registry volume exists
command: "{{ glusterfs_heketi_client }} volume list"
register: registry_volume
- name: Create GlusterFS registry volume
- command: "{{ glusterfs_heketi_client }} volume create --size={{ openshift.hosted.registry.storage.volume.size | replace('Gi','') }} --name={{ openshift.hosted.registry.storage.glusterfs.path }}"
- when: "openshift.hosted.registry.storage.glusterfs.path not in registry_volume.stdout"
+ command: "{{ glusterfs_heketi_client }} volume create --size={{ openshift_hosted_registry_storage_volume_size | replace('Gi','') }} --name={{ openshift_hosted_registry_storage_glusterfs_path }}"
+ when: "openshift_hosted_registry_storage_glusterfs_path not in registry_volume.stdout"