Skip to content

Commit d08bfd6

Browse files
committed
[OSASINFRA] Adapt shiftstack role for adoption
The ansible controller when running the adoption is the "controller" VM while it's the "controller-0" VM for a regular RHOSO+openshift deployment. This PR addresses the required adaptations in the shiftstack role so it's compatible with the adoption process.
1 parent ffa7b99 commit d08bfd6

File tree

2 files changed

+30
-19
lines changed

2 files changed

+30
-19
lines changed

roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,20 @@
1818
ansible.builtin.command: oc config use-context admin --kubeconfig={{ cifmw_openshift_kubeconfig }}
1919
changed_when: true
2020

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
2233
ansible.builtin.set_fact:
23-
incluster_kubeconfig_base64: "{{ lookup('ansible.builtin.file', cifmw_openshift_kubeconfig ) | b64encode }}"
34+
incluster_kubeconfig_base64: "{{ kubeconfig_slurp.content }}"
2435

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

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) }}"
5061

5162
- name: Render the pod manifest from a template
5263
ansible.builtin.template:

roles/shiftstack/templates/shiftstackclient_pod.yml.j2

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ spec:
3838
- mountPath: /home/cloud-admin/.original-config/cert/
3939
name: openstack-cert
4040
readOnly: true
41-
- name: installation-volume
42-
mountPath: {{ cifmw_shiftstack_shiftstackclient_installation_dir }}
41+
# - name: installation-volume
42+
# mountPath: {{ cifmw_shiftstack_shiftstackclient_installation_dir }}
4343
- name: {{ cifmw_shiftstack_client_incluster_secret_name }}-volume
4444
mountPath: {{ cifmw_shiftstack_shiftstackclient_incluster_kubeconfig_dir }}
4545
readOnly: true
@@ -76,6 +76,6 @@ spec:
7676
secret:
7777
defaultMode: 292
7878
secretName: rootca-public
79-
- name: installation-volume
80-
persistentVolumeClaim:
81-
claimName: {{ cifmw_shiftstack_client_pod_name }}-pvc
79+
# - name: installation-volume
80+
# persistentVolumeClaim:
81+
# claimName: {{ cifmw_shiftstack_client_pod_name }}-pvc

0 commit comments

Comments
 (0)