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

[bug] .bashrc updated in wrong user #212

Open
dougbtv opened this issue Mar 23, 2018 · 5 comments
Open

[bug] .bashrc updated in wrong user #212

dougbtv opened this issue Mar 23, 2018 · 5 comments

Comments

@dougbtv
Copy link
Member

dougbtv commented Mar 23, 2018

Bashrc is being updated in the /home/centos user every time, likely it's missing the variable.

@dougbtv
Copy link
Member Author

dougbtv commented Mar 23, 2018

Here's the culprit:

roles/kube-cni/defaults/main.yml:3:kubectl_home: /home/centos

@leifmadsen leifmadsen changed the title .bashrc updated in wrong user [bug] .bashrc updated in wrong user Apr 4, 2018
@leifmadsen
Copy link
Contributor

I don't get what the issue is in this bug :)

@dougbtv
Copy link
Member Author

dougbtv commented Apr 4, 2018

The gist is, if you're using a user other than centos -- which works for 90% of the time, if you've brought your own deployment that doesn't have a centos user, this doesn't follow the construct we use elsewhere. e.g. in this line in a defaults file it reads a static:

kubectl_home: /home/centos

Whereas in other files, such as this example, we use something like:

dest: "{{ ansible_env.HOME }}/{{ gopath }}/github.com/opencontainers/runc"

So if you are using a different user -- you'll never be able to issue a kubectl command later in the playbooks

@leifmadsen
Copy link
Contributor

Would you suggest we just drop the use of kubectl_home everywhere and replace with ansible_env.HOME instead?

This is used in a few spots (just doing a quick grep). The following is the list of roles using it:

  • kube-init
  • kube-install
  • kube-teardown
  • kube-cni

@dougbtv
Copy link
Member Author

dougbtv commented Apr 4, 2018

I think that'd probably work great, I think the kubectl_home variable is a hangover from earlier iterations before some of this stuff got standardized, and likely it was a variable lofted into a default from group_vars/all and just kinda got lost in the shuffle.

@leifmadsen leifmadsen self-assigned this Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants