summaryrefslogtreecommitdiffstats
path: root/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
diff options
context:
space:
mode:
authorJose A. Rivera <jarrpa@redhat.com>2017-10-16 15:55:31 -0500
committerJose A. Rivera <jarrpa@redhat.com>2017-11-08 08:51:24 -0600
commitcfe73d1ebb9a29d51f0e96aa6df561b52332f859 (patch)
treec256897a057dd99fb2c55216be1ac19f34e97346 /roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
parent5b85d56f5b2a5f3cc21fcdd17a3237d44b35c375 (diff)
downloadopenshift-cfe73d1ebb9a29d51f0e96aa6df561b52332f859.tar.gz
openshift-cfe73d1ebb9a29d51f0e96aa6df561b52332f859.tar.bz2
openshift-cfe73d1ebb9a29d51f0e96aa6df561b52332f859.tar.xz
openshift-cfe73d1ebb9a29d51f0e96aa6df561b52332f859.zip
GlusterFS: Add gluster-s3 functionality
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Diffstat (limited to 'roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml')
-rw-r--r--roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml95
1 files changed, 50 insertions, 45 deletions
diff --git a/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml b/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
index 4e5bf69de..2a678af57 100644
--- a/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
+++ b/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
@@ -259,54 +259,59 @@
- glusterfs_heketi_is_native
- glusterfs_heketi_is_missing
-- name: Create heketi secret
- oc_secret:
- namespace: "{{ glusterfs_namespace }}"
- state: present
- name: "heketi-{{ glusterfs_name }}-admin-secret"
- type: "kubernetes.io/glusterfs"
- force: True
- contents:
- - path: key
- data: "{{ glusterfs_heketi_admin_key }}"
- when:
- - glusterfs_storageclass
- - glusterfs_heketi_admin_key is defined
-
-- name: Get heketi route
- oc_obj:
- namespace: "{{ glusterfs_namespace }}"
- kind: route
- state: list
- name: "heketi-{{ glusterfs_name }}"
- register: heketi_route
- when:
- - glusterfs_storageclass
- - glusterfs_heketi_is_native
-
-- name: Determine StorageClass heketi URL
+- name: Check if gluster-s3 can't be deployed
set_fact:
- glusterfs_heketi_route: "{{ heketi_route.results.results[0]['spec']['host'] }}"
+ glusterfs_s3_deploy: False
when:
- - glusterfs_storageclass
- - glusterfs_heketi_is_native
-
-- name: Generate GlusterFS StorageClass file
- template:
- src: "{{ openshift.common.examples_content_version }}/glusterfs-storageclass.yml.j2"
- dest: "{{ mktemp.stdout }}/glusterfs-storageclass.yml"
+ - "glusterfs_s3_account is not defined or glusterfs_s3_user is not defined or glusterfs_s3_password is not defined"
+
+- block:
+ - name: Create heketi secret
+ oc_secret:
+ namespace: "{{ glusterfs_namespace }}"
+ state: present
+ name: "heketi-{{ glusterfs_name }}-admin-secret"
+ type: "kubernetes.io/glusterfs"
+ force: True
+ contents:
+ - path: key
+ data: "{{ glusterfs_heketi_admin_key }}"
+ when:
+ - glusterfs_heketi_admin_key is defined
+
+ - name: Get heketi route
+ oc_obj:
+ namespace: "{{ glusterfs_namespace }}"
+ kind: route
+ state: list
+ name: "heketi-{{ glusterfs_name }}"
+ register: heketi_route
+ when:
+ - glusterfs_heketi_is_native
+
+ - name: Determine StorageClass heketi URL
+ set_fact:
+ glusterfs_heketi_route: "{{ heketi_route.results.results[0]['spec']['host'] }}"
+ when:
+ - glusterfs_heketi_is_native
+
+ - name: Generate GlusterFS StorageClass file
+ template:
+ src: "{{ openshift.common.examples_content_version }}/glusterfs-storageclass.yml.j2"
+ dest: "{{ mktemp.stdout }}/glusterfs-storageclass.yml"
+
+ - name: Create GlusterFS StorageClass
+ oc_obj:
+ state: present
+ kind: storageclass
+ name: "glusterfs-{{ glusterfs_name }}"
+ files:
+ - "{{ mktemp.stdout }}/glusterfs-storageclass.yml"
when:
- - glusterfs_storageclass
-
-- name: Create GlusterFS StorageClass
- oc_obj:
- state: present
- kind: storageclass
- name: "glusterfs-{{ glusterfs_name }}"
- files:
- - "{{ mktemp.stdout }}/glusterfs-storageclass.yml"
- when:
- - glusterfs_storageclass
+ - glusterfs_storageclass or glusterfs_s3_deploy
- include: glusterblock_deploy.yml
when: glusterfs_block_deploy
+
+- include: gluster_s3_deploy.yml
+ when: glusterfs_s3_deploy