Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
smolin-de opened this issue Jul 10, 2023 · 1 comment

Comments

@smolin-de
Copy link
Contributor

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"

@mohammedzee1000
Copy link
Member

mohammedzee1000 commented Oct 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants