ansible/ansible — pull request #3579 by jeromew (2013-07-18 22:46:12+00:00)
Title: Implement sudo/sudo_user at the include and role levels

Hello,

After our discussion on the mailing list about 2 weeks ago, here is a pull request regarding the implementation of sudo/sudo_user behavior at the include and role level.

Implementation at the role level requires implementation at the include level because of the way roles are implemented.

There is no automated test since I am not familiar with ansible test suite and I am not sure how sudo/sudo_user behaviors can be tested. I could give it a try if you point me in the right direction.

Nevertheless I did some tests that make me confident in the implementation.

The implementation is what I call "deepest setting wins downward" :
* any sudo or sudo_user that is set at one point in the include/task hierarchy flows downward
* any sudo or sudo_user that is set at one point in the hierachy replaces any upward setting"

best regards