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

Possible ansible Template issue preventing use of /etc/sudoers.d/deploy for locking down NOPASSWD #1

Open
Bochenski opened this issue Aug 21, 2013 · 0 comments
Assignees
Labels

Comments

@Bochenski
Copy link
Member

Currently, we set /etc/sudoers.d/deploy to:

deploy ALL=(ALL)NOPASSWD:ALL

which allows the deploy user to run sudo commands without a password prompt

We want to lock this down to specific sudo commands ie:

deploy ALL=(ALL)NOPASSWD:/usr/bin/apt-get,/usr.bin/apt-key

etc.

but it appears that the moment you put a / in the template file

(roles/common/templates/deploy.sudoers)

then the visudo -cf fails to validate the file when the task runs, citing a synax error

if you remove the validation check, indeed the sudoers file is corrupted.

Manually edit the file, by deleting whatever character is at the end of the line, it then validates fine. So I suspect some dodgy unicode character is being inserted by ansible templating - i.e jinja which is causing sudoers to barf.

I will try and see if I can isolate what line endings are being used.

@ghost ghost assigned bwghughes Aug 21, 2013
Bochenski added a commit that referenced this issue Aug 21, 2013
@Bochenski Bochenski assigned Bochenski and unassigned bwghughes Mar 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants