jdauphant/ansible-role-nginx

seems to be missing superuser rights

Closed this issue · 14 comments

scrum-for-developers/scrum-for-developers-infra#5 shows an issue with restarting nginx.

http://stackoverflow.com/a/23821590 suggests that superuser rights are missing for that test.

Strange this problem should have been reported before.
What is you OS ?
It possible that the role don't setup good right on some OS.

I am also experiencing this issue. Any workaround besides redefining the handler?

@AndreasEK @joaosa can you give more details of your environnement ? (OS, versions, if you use docker, etc)
I prefer check that isn't a misconfiguration before we use the easy fix.

Is it expected that users should use become: true in the playbook? I certainly always do.

I don't understand how you could install the nginx package otherwise?

@philipwigg This was design before "become" was introduced (it was "sudo" before but sudo isn't a universal way to become root).
I didn't know the current good practices around "become".

@jdauphant I'm running: macOS El Capitan; ansible 2.2.0.0; I'm not using Docker.

You can find all our setup scripts here:
https://github.com/scrum-for-developers/scrum-for-developers-infra/tree/master/ansible

On the client, I'm running macOS with ansible 2.2. Server is an Ubuntu 16.04 LTS.

I have to admit, that I'm not too familiar with best practices, but my expectations are that if I include a role, that this is self contained. And if it requires root priviledges (become: true), it should take care of that, without requiring the user to remember that.

Same issue, same config as @joaosa ;)

It work's in Ansible 2.1 and fail in 2.2, something have changed in Ansible 2.2 .
I will try to figure if it's a bug or a feature

@AndreasEK @joaosa @philipwigg @jdesboeufs It's link to an ansible bug: ansible/ansible#17490 it will be solve in 2.2.1

Also we will have to think about introduced "become" or not into the role, the previous way was forcing the user to use sudo (and sudo isn't the only way to become root). I prefer not look this option for user.

I've also hit on this issue and I'm actually using become: yes when including the role (as a dependency, on the meta/main.yml file). Anyone else with this behaviour?

EDIT: And now I properly read the previously mentioned issue and felt silly! :/ Got it, thanks!
What workaround are you using? Downgrading ansible?

The current solution is to downgrade Ansible to 2.1

Ansible 2.2.1.0 has been released, and it appears to be working as expected.

Thanks for the update