summaryrefslogtreecommitdiffstats
path: root/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
diff options
context:
space:
mode:
authorOpenShift Bot <eparis+openshiftbot@redhat.com>2017-06-19 13:19:40 -0400
committerGitHub <noreply@github.com>2017-06-19 13:19:40 -0400
commit326d8e530db5f0cfcbc1a77451150699063e900e (patch)
treecf25b17eb27b7cab361e84c02b3eb4445521e374 /roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
parentf6de39e8f38d77565481bc9709ec0be5d9d4c6ab (diff)
parentb1c40b3dbbc7cfbf9ed0f6f657a68b4ea6a53136 (diff)
downloadopenshift-326d8e530db5f0cfcbc1a77451150699063e900e.tar.gz
openshift-326d8e530db5f0cfcbc1a77451150699063e900e.tar.bz2
openshift-326d8e530db5f0cfcbc1a77451150699063e900e.tar.xz
openshift-326d8e530db5f0cfcbc1a77451150699063e900e.zip
Merge pull request #4484 from jarrpa/glusterfs-fixes-too
Merged by openshift-bot
Diffstat (limited to 'roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml')
-rw-r--r--roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml51
1 files changed, 42 insertions, 9 deletions
diff --git a/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml b/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
index 829c1f51b..4406ef28b 100644
--- a/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
+++ b/roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml
@@ -123,21 +123,32 @@
when:
- glusterfs_heketi_topology_load
-- include: heketi_deploy_part1.yml
+- name: Generate heketi admin key
+ set_fact:
+ glusterfs_heketi_admin_key: "{{ 32 | oo_generate_secret }}"
when:
- glusterfs_heketi_is_native
- - glusterfs_heketi_deploy_is_missing
- - glusterfs_heketi_is_missing
+ - glusterfs_heketi_admin_key is undefined
-- name: Set heketi URL
+- name: Generate heketi user key
set_fact:
- glusterfs_heketi_url: "localhost:8080"
+ glusterfs_heketi_user_key: "{{ 32 | oo_generate_secret }}"
+ until: "glusterfs_heketi_user_key != glusterfs_heketi_admin_key"
+ delay: 1
+ retries: 10
+ when:
+ - glusterfs_heketi_is_native
+ - glusterfs_heketi_user_key is undefined
+
+- include: heketi_deploy_part1.yml
when:
- glusterfs_heketi_is_native
+ - glusterfs_heketi_deploy_is_missing
+ - glusterfs_heketi_is_missing
- name: Set heketi-cli command
set_fact:
- glusterfs_heketi_client: "{% if glusterfs_heketi_is_native %}oc rsh {{ heketi_pod.results.results[0]['items'][0]['metadata']['name'] }} {% endif %}heketi-cli -s http://{{ glusterfs_heketi_url }} --user admin --secret '{{ glusterfs_heketi_admin_key }}'"
+ glusterfs_heketi_client: "{% if glusterfs_heketi_is_native %}oc rsh {{ heketi_pod.results.results[0]['items'][0]['metadata']['name'] }} {% endif %}heketi-cli -s http://{% if glusterfs_heketi_is_native %}localhost:8080{% else %}{{ glusterfs_heketi_url }}:{{ glusterfs_heketi_port }}{% endif %} --user admin --secret '{{ glusterfs_heketi_admin_key }}'"
- name: Verify heketi service
command: "{{ glusterfs_heketi_client }} cluster list"
@@ -155,21 +166,43 @@
- glusterfs_heketi_is_native
- glusterfs_heketi_is_missing
-- name: Create heketi user secret
+- name: Create heketi secret
oc_secret:
namespace: "{{ glusterfs_namespace }}"
state: present
- name: "heketi-{{ glusterfs_name }}-user-secret"
+ name: "heketi-{{ glusterfs_name }}-secret"
type: "kubernetes.io/glusterfs"
force: True
contents:
- path: key
- data: "{{ glusterfs_heketi_user_key }}"
+ data: "{{ glusterfs_heketi_admin_key }}"
+ when:
+ - glusterfs_storageclass
+
+- 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
+ set_fact:
+ glusterfs_heketi_route: "{{ heketi_route.results.results[0]['spec']['host'] }}"
+ 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"
+ when:
+ - glusterfs_storageclass
- name: Create GlusterFS StorageClass
oc_obj: