ansible/ansible — pull request #3571 by mvo5 (2013-07-18 08:18:15+00:00)
Title: run sudo -K on ssh close to ensure sudo credentials are not cached

This branch runs a "sudo -K" at the end of the ssh session to ensure that the users credentials are not cached with sudo. This seems to be needed on older versions of ubuntu (i.e. 10.04). Here I can do a sudo without a password after ansible was run on the server.

To test, run:
$ ansible -c ssh -K -u username -m setup hostname-with-ubuntu-10.04
$ ssh -t username@hostname-with-ubuntu-10.04 sudo id

On a ubuntu 10.04 system this will do a sudo without password. On 12.04 or with this branch it will prompt for the sudo password (as expected).

Thanks,
Michael