ansible/ansible — pull request #2970 by rodlogic (2013-05-22 06:04:38+00:00)
Title: added support for ssh tunneling using ssh's ProxyCommand option

This commit introduces a new variable named ansible_ssh_proxy_cmd that can be associated with individual hosts and used to tunnel task executions through a proxy/tunnel host using the ssh transport.

I have a scenario where I need to run ansible tasks against LXC containers created in an Ubuntu VirtualBox machine from an OSX notebook. So ansible needs to ssh into the LXC container through the Ubuntu VM hosting it.

With this commit, it is possible to specify a host such as:
```
[webservers]
app ansible_ssh_user=ubuntu ansible_connection=ssh ansible_ssh_proxy_cmd='ssh vagrant@localhost -p 2222 nc %h %p 2>/dev/null'
```
This will add a new option to the ssh transport:
```
-o 'ProxyCommand ssh vagrant@localhost -p 2222 nc %h %p 2>/dev/null' to the ssh and scp exec command in ssh.py. I have also added this option to the sftp command, but I have no idea if it will work.