Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,20 @@
ansible.builtin.command: oc config use-context admin --kubeconfig={{ cifmw_openshift_kubeconfig }}
changed_when: true

- name: Encode kubeconfig file to Base64
#- name: Encode kubeconfig file to Base64
# ansible.builtin.set_fact:
# incluster_kubeconfig_base64: "{{ lookup('ansible.builtin.file', cifmw_openshift_kubeconfig ) | b64encode }}"
#
# ^ Fails if file is only on remote target (Ansible Lookup is Local to the Control Node)

- name: Slurp and Encode kubeconfig file to Base64
ansible.builtin.slurp:
src: "{{ cifmw_openshift_kubeconfig }}"
register: kubeconfig_slurp

- name: Set Base64 fact for the kubeconfig
ansible.builtin.set_fact:
incluster_kubeconfig_base64: "{{ lookup('ansible.builtin.file', cifmw_openshift_kubeconfig ) | b64encode }}"
incluster_kubeconfig_base64: "{{ kubeconfig_slurp.content }}"

- name: Render the incluster kubeconfig secret manifest
ansible.builtin.template:
Expand All @@ -35,18 +46,18 @@
src: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_incluster_secret_manifest) | path_join }}"
proxy: "{{ cifmw_shiftstack_proxy | default(omit) }}"

- name: Render the pvc manifest
ansible.builtin.template:
src: templates/shiftstackclient_pvc.yml.j2
dest: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_pvc_manifest) | path_join }}"
mode: "0644"

- name: Apply the manifest for the PVC creation
kubernetes.core.k8s:
state: present
kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
src: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_pvc_manifest) | path_join }}"
proxy: "{{ cifmw_shiftstack_proxy | default(omit) }}"
#- name: Render the pvc manifest
# ansible.builtin.template:
# src: templates/shiftstackclient_pvc.yml.j2
# dest: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_pvc_manifest) | path_join }}"
# mode: "0644"
#
#- name: Apply the manifest for the PVC creation
# kubernetes.core.k8s:
# state: present
# kubeconfig: "{{ cifmw_openshift_kubeconfig }}"
# src: "{{ (cifmw_shiftstack_manifests_dir, cifmw_shiftstack_client_pvc_manifest) | path_join }}"
# proxy: "{{ cifmw_shiftstack_proxy | default(omit) }}"

- name: Render the pod manifest from a template
ansible.builtin.template:
Expand Down
10 changes: 5 additions & 5 deletions roles/shiftstack/templates/shiftstackclient_pod.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ spec:
- mountPath: /home/cloud-admin/.original-config/cert/
name: openstack-cert
readOnly: true
- name: installation-volume
mountPath: {{ cifmw_shiftstack_shiftstackclient_installation_dir }}
# - name: installation-volume
# mountPath: {{ cifmw_shiftstack_shiftstackclient_installation_dir }}
- name: {{ cifmw_shiftstack_client_incluster_secret_name }}-volume
mountPath: {{ cifmw_shiftstack_shiftstackclient_incluster_kubeconfig_dir }}
readOnly: true
Expand Down Expand Up @@ -76,6 +76,6 @@ spec:
secret:
defaultMode: 292
secretName: rootca-public
- name: installation-volume
persistentVolumeClaim:
claimName: {{ cifmw_shiftstack_client_pod_name }}-pvc
# - name: installation-volume
# persistentVolumeClaim:
# claimName: {{ cifmw_shiftstack_client_pod_name }}-pvc
Loading