|
18 | 18 | ansible.builtin.command: oc config use-context admin --kubeconfig={{ cifmw_openshift_kubeconfig }} |
19 | 19 | changed_when: true |
20 | 20 |
|
21 | | -- name: Encode kubeconfig file to Base64 |
| 21 | +#- name: Encode kubeconfig file to Base64 |
| 22 | +# ansible.builtin.set_fact: |
| 23 | +# incluster_kubeconfig_base64: "{{ lookup('ansible.builtin.file', cifmw_openshift_kubeconfig ) | b64encode }}" |
| 24 | +# |
| 25 | +# ^ Fails if file is only on remote target (Ansible Lookup is Local to the Control Node) |
| 26 | + |
| 27 | +- name: Slurp and Encode kubeconfig file to Base64 |
| 28 | + ansible.builtin.slurp: |
| 29 | + src: "{{ cifmw_openshift_kubeconfig }}" |
| 30 | + register: kubeconfig_slurp |
| 31 | + |
| 32 | +- name: Set Base64 fact for the kubeconfig |
22 | 33 | ansible.builtin.set_fact: |
23 | | - incluster_kubeconfig_base64: "{{ lookup('ansible.builtin.file', cifmw_openshift_kubeconfig ) | b64encode }}" |
| 34 | + incluster_kubeconfig_base64: "{{ kubeconfig_slurp.content }}" |
24 | 35 |
|
25 | 36 | - name: Render the incluster kubeconfig secret manifest |
26 | 37 | ansible.builtin.template: |
|
35 | 46 | src: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_incluster_secret_manifest) | path_join }}" |
36 | 47 | proxy: "{{ cifmw_shiftstack_proxy | default(omit) }}" |
37 | 48 |
|
38 | | -- name: Render the pvc manifest |
39 | | - ansible.builtin.template: |
40 | | - src: templates/shiftstackclient_pvc.yml.j2 |
41 | | - dest: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_pvc_manifest) | path_join }}" |
42 | | - mode: "0644" |
43 | | - |
44 | | -- name: Apply the manifest for the PVC creation |
45 | | - kubernetes.core.k8s: |
46 | | - state: present |
47 | | - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
48 | | - src: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_pvc_manifest) | path_join }}" |
49 | | - proxy: "{{ cifmw_shiftstack_proxy | default(omit) }}" |
| 49 | +#- name: Render the pvc manifest |
| 50 | +# ansible.builtin.template: |
| 51 | +# src: templates/shiftstackclient_pvc.yml.j2 |
| 52 | +# dest: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_pvc_manifest) | path_join }}" |
| 53 | +# mode: "0644" |
| 54 | +# |
| 55 | +#- name: Apply the manifest for the PVC creation |
| 56 | +# kubernetes.core.k8s: |
| 57 | +# state: present |
| 58 | +# kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
| 59 | +# src: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_pvc_manifest) | path_join }}" |
| 60 | +# proxy: "{{ cifmw_shiftstack_proxy | default(omit) }}" |
50 | 61 |
|
51 | 62 | - name: Render the pod manifest from a template |
52 | 63 | ansible.builtin.template: |
|
0 commit comments