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

Replace sudo with become and --ask-become-pass #29

Closed
NickVolynkin opened this issue Jan 16, 2019 · 2 comments
Closed

Replace sudo with become and --ask-become-pass #29

NickVolynkin opened this issue Jan 16, 2019 · 2 comments

Comments

@NickVolynkin
Copy link

NickVolynkin commented Jan 16, 2019

This roles uses become to let ansible operate as a privileged user. This is the right and preferred way. But instead of asking for become password, the README recommends to run ansible with sudo:

sudo ansible-playbook -i "localhost," -c local playbook.yml

This doesn't seem to be the right or required practice. For me it resulted in files in my ~/ owned by root a couple of times. Instead, we can tell ansible to ask for password with --ask-become-pass or -K:

ansible-playbook -i "localhost," -c local -K playbook.yml

Also, it seems that ansible-galaxy does not need sudo either:

sudo ansible-galaxy install viasite-ansible.zsh

If you agree, I will throw a pull-request myself.

@popstas
Copy link
Contributor

popstas commented Jan 17, 2019

Agreed

@popstas
Copy link
Contributor

popstas commented Jun 15, 2020

Late fix ) I'm used -b instead of -K, also removed sudo from ansible-galaxy.

After install check root owned files:

find ~ -user root

No root files after install on clean Ubuntu 20.20.

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