Ver Fonte

Merge pull request #7205 from DanyC97/glusterfs-verify-heketi-service

Automatic merge from submit-queue.

GlusterFS - Invoke oc binary with the admin.kubeconfig token rather t…

…han default token from /Users/$HOME/.kube/config

Fix https://github.com/openshift/openshift-ansible/issues/7162 in particular the error

```
TASK [openshift_storage_glusterfs : Verify heketi service] ***********************************************************************************************************************************************
Wednesday 14 February 2018  23:11:59 +0000 (0:00:00.142)       0:15:50.334 ****
fatal: [370-master1]: FAILED! => {"changed": false, "cmd": ["oc", "rsh", "--namespace=glusterfs", "deploy-heketi-storage-1-vsthp", "heketi-cli", "-s", "http://localhost:8080", "--user", "admin", "--secret", "redacted", "cluster", "list"], "delta": "0:00:00.282764", "end": "2018-02-14 23:11:22.464301", "msg": "non-zero return code", "rc": 1, "start": "2018-02-14 23:11:22.181537", "stderr": "error: You must be logged in to the server (the server has asked for the client to provide credentials (get pods deploy-heketi-storage-1-vsthp))", "stderr_lines": ["error: You must be logged in to the server (the server has asked for the client to provide credentials (get pods deploy-heketi-storage-1-vsthp))"], "stdout": "", "stdout_lines": []}

```

@jarrpa  please review it
OpenShift Merge Robot há 7 anos atrás
pai
commit
0eac47dd77

Diff do ficheiro suprimidas por serem muito extensas
+ 2 - 2
roles/openshift_storage_glusterfs/tasks/glusterfs_common.yml


+ 2 - 9
roles/openshift_storage_glusterfs/tasks/heketi_deploy_part2.yml

@@ -4,14 +4,7 @@
   register: setup_storage
 
 - name: Copy heketi-storage list
-  shell: "{{ openshift_client_binary }} rsh --namespace={{ glusterfs_namespace }} {{ deploy_heketi_pod.results.results[0]['items'][0]['metadata']['name'] }} cat /tmp/heketi-storage.json > {{ mktemp.stdout }}/heketi-storage.json"
-
-# This is used in the subsequent task
-- name: Copy the admin client config
-  command: >
-    cp {{ openshift.common.config_base }}/master/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
-  changed_when: False
-  check_mode: no
+  shell: "{{ openshift_client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig rsh --namespace={{ glusterfs_namespace }} {{ deploy_heketi_pod.results.results[0]['items'][0]['metadata']['name'] }} cat /tmp/heketi-storage.json > {{ mktemp.stdout }}/heketi-storage.json"
 
 # Need `command` here because heketi-storage.json contains multiple objects.
 - name: Copy heketi DB to GlusterFS volume
@@ -126,7 +119,7 @@
 
 - name: Set heketi-cli command
   set_fact:
-    glusterfs_heketi_client: "{{ openshift_client_binary }} rsh --namespace={{ glusterfs_namespace }} {{ heketi_pod.results.results[0]['items'][0]['metadata']['name'] }} {{ glusterfs_heketi_cli }} -s http://localhost:8080 --user admin --secret '{{ glusterfs_heketi_admin_key }}'"
+    glusterfs_heketi_client: "{{ openshift_client_binary }} --config={{ mktemp.stdout }}/admin.kubeconfig rsh --namespace={{ glusterfs_namespace }} {{ heketi_pod.results.results[0]['items'][0]['metadata']['name'] }} {{ glusterfs_heketi_cli }} -s http://localhost:8080 --user admin --secret '{{ glusterfs_heketi_admin_key }}'"
 
 - name: Verify heketi service
   command: "{{ glusterfs_heketi_client }} cluster list"

+ 6 - 0
roles/openshift_storage_glusterfs/tasks/main.yml

@@ -5,6 +5,12 @@
   changed_when: False
   check_mode: no
 
+- name: Copy the admin client config
+  command: >
+    cp {{ openshift.common.config_base }}/master/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
+  changed_when: False
+  check_mode: no
+
 - include_tasks: glusterfs_config.yml
   when:
   - groups.glusterfs | default([]) | count > 0