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

sudo/become at playbook level vs. task level #281

Open
discopatrick opened this issue May 20, 2016 · 3 comments
Open

sudo/become at playbook level vs. task level #281

discopatrick opened this issue May 20, 2016 · 3 comments

Comments

@discopatrick
Copy link

Phansible is currently generating projects that have sudo: true at the playbook level, but also many instances of sudo: yes at the task level.

As far as I know, sudo: true at the playbook level will automatically make all tasks in that playbook run as sudo, unless overridden per task with sudo: false or sudo: no. This makes redundant the many instances of sudo: yes at the task level. Perhaps they should be removed.

Alternatively, and this is my preference - sudo should only ever be defined at the task level. This is because, if a task is possible to achieve without becoming root, I'd rather do it as the vagrant user, and only elevate to root if absolutely necessary. In this case, sudo: true should be removed from playbook.yml.

@debo
Copy link
Member

debo commented May 20, 2016

Hi @discopatrick that is accurate and I do agree with you. The reason why sudo: yes, and soon become: yes, are still there is mostly legacy. We are going through the process as you might have seen to decouple the playbooks in isolated repo and we mainly focused initially on quality and testing (work in progress there). Now that we have at least the very bare minimum amount of CI tasks running with idempotency check we can, moving forward, surely improve the quality of our playbooks and address the issue you raised. I hope that clarifies better the current status.

@discopatrick
Copy link
Author

Thanks for the reply, and the great explanation.

@debo
Copy link
Member

debo commented May 20, 2016

And thanks to you for the input, always appreciated.

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