Proposal: rename sudo_user to sudo_to

Coming from Ubuntu-land where the root account has ssh disabled, I think of the “sudo user” as the user that has sudo privileges. However, Ansible uses “sudo_user” to mean “user to sudo to”.

What do people think of the idea of using “sudo_to” or “sudo_as” instead of “sudo_user”, to make this more explicit? “sudo_user” could still be an alias.

Lorin

Sounds good.

Send me a patch that also changes all the examples in examples/playbooks, but doesn’t change the variable names (API compatibility is important), and I’ll take it.

I think it should have also be true that if you set sudo_user/sudo_to you auto-engage sudo, though we can’t really do that without breaking some meaning we’ve established around the environment variables and defaults, and am unwilling to change that.

It probably SHOULD be an error in play.py to set sudo_user and not set “sudo”, because the user basically made a typo in that case.

–Michael

Thinking about this some more…

The command line happens to take --sudo-user now, so I don’t think we should change that in Ansible.

I am generally thinking aliases are confusing to different users who share playbooks with one another, so we should probably not change this.