# SSH connection ignores timeout "-T" on ansible

**URL:** <https://forum.ansible.com/t/ssh-connection-ignores-timeout-t-on-ansible/12286>\
**Category:** Ansible Project\
**Created:** [February 3, 2013, 3:32am UTC](https://forum.ansible.com/t/ssh-connection-ignores-timeout-t-on-ansible/12286 "2013-02-03T03:32:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdavis](https://avatars.discourse-cdn.com/v4/letter/f/a698b9/32.png) [@fdavis](https://forum.ansible.com/u/fdavis)\
**Post date:** [February 3, 2013, 3:32am UTC](https://forum.ansible.com/t/ssh-connection-ignores-timeout-t-on-ansible/12286/1 "2013-02-03T03:32:04Z")

</div>

It seems that the ssh connection plugin ignores the timeout setting from ansible.  
Are we supposed to set the timeout in ansible\_ssh\_args? (something like ConnectTimeout=10)

When I ran this on several machines previously, I only got the “FAILED =\> failed to transfer” message,  
not the following “ssh: connect…” message.

See below for example. I’m dropping input packets on lo to simulate an unresponsive host.

~$ time ansible localhost -m command -a ‘echo bob’ -T 10 -c ssh  
localhost | FAILED =\> failed to transfer file to /command:

Connecting to localhost…  
ssh: connect to host localhost port 22: Connection timed out  
Couldn’t read packet: Connection reset by peer

real 2m6.876s  
user 0m0.784s  
sys 0m0.113s

$ ansible --version  
ansible 1.0 (devel e166f71fcc) last updated 2013/01/28 16:31:44 (GMT -700)

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [February 3, 2013, 3:42am UTC](https://forum.ansible.com/t/ssh-connection-ignores-timeout-t-on-ansible/12286/2 "2013-02-03T03:42:32Z")

</div>

I agree. It seems to only be passing timeout to the select statement.

Anyone else have thoughts?

passing -o ConnectTimeout seems quite reasonable to me.
