diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2017-11-14 09:51:08 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-14 09:51:08 -0800 |
commit | 3cdf382be563207c62d22fac87ad57433fa6dd31 (patch) | |
tree | 2ec93276ef2fd71b91d621a56764f04e675d7917 /roles/openshift_storage_glusterfs/tasks/glusterblock_deploy.yml | |
parent | 2e6369358b8ec30cb3031ec5de9f126f07c12521 (diff) | |
parent | cfe73d1ebb9a29d51f0e96aa6df561b52332f859 (diff) | |
download | openshift-3cdf382be563207c62d22fac87ad57433fa6dd31.tar.gz openshift-3cdf382be563207c62d22fac87ad57433fa6dd31.tar.bz2 openshift-3cdf382be563207c62d22fac87ad57433fa6dd31.tar.xz openshift-3cdf382be563207c62d22fac87ad57433fa6dd31.zip |
Merge pull request #5784 from jarrpa/glusterfs-new-features
Automatic merge from submit-queue.
GlusterFS: Update for new features
This is a small collection of updates to take advantage of new features available for containerized GlusterFS, currently available downstream in CNS 3.6.
Diffstat (limited to 'roles/openshift_storage_glusterfs/tasks/glusterblock_deploy.yml')
-rw-r--r-- | roles/openshift_storage_glusterfs/tasks/glusterblock_deploy.yml | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/roles/openshift_storage_glusterfs/tasks/glusterblock_deploy.yml b/roles/openshift_storage_glusterfs/tasks/glusterblock_deploy.yml new file mode 100644 index 000000000..bba1de654 --- /dev/null +++ b/roles/openshift_storage_glusterfs/tasks/glusterblock_deploy.yml @@ -0,0 +1,66 @@ +--- +- name: Delete pre-existing glusterblock provisioner resources + oc_obj: + namespace: "{{ glusterfs_namespace }}" + kind: "{{ item.kind }}" + name: "{{ item.name | default(omit) }}" + selector: "{{ item.selector | default(omit) }}" + state: absent + with_items: + - kind: "all,deploy,sa,clusterrole,clusterrolebinding" + selector: "glusterblock" + failed_when: False + when: glusterfs_wipe + +- name: Wait for glusterblock provisioner pods to terminate + oc_obj: + namespace: "{{ glusterfs_namespace }}" + kind: pod + state: list + selector: "glusterfs=block-{{ glusterfs_name }}-provisioner-pod" + register: glusterblock_pod + until: "glusterblock_pod.results.results[0]['items'] | count == 0" + delay: 10 + retries: "{{ (glusterfs_timeout | int / 10) | int }}" + when: glusterfs_wipe + +- name: Copy initial glusterblock provisioner resource file + copy: + src: "{{ openshift.common.examples_content_version }}/{{ item }}" + dest: "{{ mktemp.stdout }}/{{ item }}" + with_items: + - "glusterblock-template.yml" + +- name: Create glusterblock provisioner template + oc_obj: + namespace: "{{ glusterfs_namespace }}" + kind: template + name: "glusterblock" + state: present + files: + - "{{ mktemp.stdout }}/glusterblock-template.yml" + +- name: Deploy glusterblock provisioner + oc_process: + namespace: "{{ glusterfs_namespace }}" + template_name: "glusterblock" + create: True + params: + IMAGE_NAME: "{{ glusterfs_block_image }}" + IMAGE_VERSION: "{{ glusterfs_block_version }}" + NAMESPACE: "{{ glusterfs_namespace }}" + CLUSTER_NAME: "{{ glusterfs_name }}" + +- name: Wait for glusterblock provisioner pod + oc_obj: + namespace: "{{ glusterfs_namespace }}" + kind: pod + state: list + selector: "glusterfs=block-{{ glusterfs_name }}-provisioner-pod" + register: glusterblock_pod + until: + - "glusterblock_pod.results.results[0]['items'] | count > 0" + # Pod's 'Ready' status must be True + - "glusterblock_pod.results.results[0]['items'] | oo_collect(attribute='status.conditions') | oo_collect(attribute='status', filters={'type': 'Ready'}) | map('bool') | select | list | count == 1" + delay: 10 + retries: "{{ (glusterfs_timeout | int / 10) | int }}" |