ansible/ansible — pull request #744 by willthames (2012-08-01 04:37:31+00:00)
Title: added su capability

I have tested this to a reasonable degree, it seems to work well with my use cases.

There are some definite improvements to be made to how configurations are applied, but I've seen you allude to that elsewhere. That would reduce the repeated code in ansible and ansible-playbook. Anyway, one for another time.

This adds a -S command line flag, it currently reuses --sudo_user (-U). It automatically asks for a password for the relevant user.

The one area of contention might be the change to paramiko_ssh - I've removed the random prompt used in the -p argument to sudo so that the same code can be used for sudo and su. If there was a compelling reason for the randbits, it might make sense to use slightly different code paths at that point.