So I'm running 3 CentOS 6.5 machines and came upon this thing which I don't understand.
server 1: client machine
server 2: ansible machine
server 3: any target machine controlled by ansible.
server 2/3 both have my public key. so when I ssh to them from server 1, it all goes well.
I ssh from server 1 to server 2 with the -a flag. (disable agent forwarding). When I run any playbook against server 3 it will fail because of permission denied (I needs my key) So this is expected.
When I ssh with the -A flag (enable agent forwarding) it should work. and so it does. Also as expected.
But now the tricky part:
Inmediatly after I ran the playbook with the ssh -A (enable agent forwarding) I disconnect from server 2 and reconnect with -a (disable agent forwarding)
I run the playbook and it DOESN't fail?
when I try to ssh from server 2 to 3 it says: permission denied (as expected since it doesn't have my key)
So the question remains. Who captures my key and leaves it there on server 2. Is this paramiko or is this Ansible. And moreover, why? Is this as designed?
I recreated this occurence on ubuntu 14.04 lts, which should indicate that paramiko is not causing this behaviour but ansible it self is.