IBM / Ansible-OpenShift-Provisioning

Automate the deployment of Red Hat OpenShift Container Platform on IBM zSystems (s390x). Automated User-Provisoned Infrastructure (UPI) setup using Kernel-based Virtual Machine (KVM).

Home Page:https://ibm.github.io/Ansible-OpenShift-Provisioning/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/root/.kube/config does not match /home/{{user}}/.kube/config when reinstall OCP cluster

smolin-de opened this issue · comments

If you do not specify 'root' as bastion user in the variable 'env.bastion.access.user', then the /root/.kube/config file will not be updated during reinstall OCP cluster.
The correct .kube/config file will be located only in the directory: "/home{{ env.bastion.access.user }}/.kube/config"

i think all home directory usages in the playbook should be replaced with

    - name: get user home directory
      shell: >
             getent passwd {{ user_name_variable }}  | awk -F: '{ print $6 }'
      changed_when: false
      register: user_home

    - name: debug output
      debug:
        var: user_home.stdout

and then use the value you get

Not only is root/non root the issue, it is also possible for someone to be using a different homedirectory than /home/username