Timeout problem with far distance host

343 views
Skip to first unread message

Jürgen Haas

unread,
Feb 27, 2017, 2:38:36 AM2/27/17
to Ansible Project
This has been discussed at many places but this scenario is certainly different. Within my repository I do have one host which is on mainland China, i.e. inside the great firewall. And therefore the connection is significantly slower than anything else. My playbooks do work most of the time, but often I do get this `Timeout (12s) waiting for privilege escalation prompt:` error - only on that host and although it is a real mirror of all the others.

I'm pretty sure this is a problem because of the connection delay and wonder if I can change the timeout just for that host.

Brian Coca

unread,
Feb 28, 2017, 9:52:38 AM2/28/17
to Ansible Project
You could set ConnectTimeout in ansible_ssh_args for that host


----------
Brian Coca

Jürgen Haas

unread,
Mar 6, 2017, 2:47:48 AM3/6/17
to Ansible Project
Here is what I've added to the host vars for that particular host:

```
ansible_ssh_args: -o ConnectTimeout=240s -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes
```

Unfortunately that didn't help. The connection timeout setting is new to this host, the other values are the default in my environment, that's why I've added them here too. Do you think any of those might be the problem? Or do I have any issues in my syntax?

Brian Coca

unread,
Mar 7, 2017, 11:23:25 AM3/7/17
to Ansible Project
Can you show -vvvv output?


----------
Brian Coca

Jürgen Haas

unread,
Mar 7, 2017, 11:59:45 AM3/7/17
to Ansible Project
That's strange, it doesn't use those settings although they are in the inventory for that host:

Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/system/setup.py
<fimfcn1> ESTABLISH SSH CONNECTION FOR USER: jurgenhaas
<fimfcn1> SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jurgenhaas -o ConnectTimeout=10 -o ControlPath=/home/jurgenhaas/.ansible/cp/ansible-ssh-%h-%p-%r fimfcn1 '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible, key=rczwjukcmjelutvbwindjqgbbipfxehz] password: " -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-rczwjukcmjelutvbwindjqgbbipfxehz; /usr/bin/python'"'"'"'"'"'"'"'"' && sleep 0'"'"''

Brian Coca

unread,
Mar 7, 2017, 12:48:46 PM3/7/17
to Ansible Project
you want:

ansible_ssh_common_args: -o ConnectTimeout=240s -o ControlMaster=auto
-o ControlPersist=60s -o ForwardAgent=yes


ansible_ssh_args does not exist, you DO have ssh_args in ansible.cfg
but that is 'global'.


--
----------
Brian Coca

Jürgen Haas

unread,
Mar 8, 2017, 2:24:55 AM3/8/17
to Ansible Project
OK, that certainly makes a difference. The output of -vvvv is now as expected and I'll deploy that to may infrastructure and will watch the behavior the next couple of days, if that stabilizes the operations on that host.

Thanks Brian for your help.

Jürgen Haas

unread,
Mar 11, 2017, 7:24:16 AM3/11/17
to Ansible Project
It's really strange. Still getting that timeout error although it is set differently:

TASK [Upgrade packages] ********************************************************
task path: /opt/ansible/playbooks/sanity.yml:36
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/core/packaging/os/apt.py
<fimfcn1> ESTABLISH SSH CONNECTION FOR USER: jurgenhaas
<fimfcn1> SSH: EXEC ssh -vvv -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=jurgenhaas -o ConnectTimeout=10 -o ConnectTimeout=240s -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes -o ControlPath=/home/jurgenhaas/.ansible/cp/ansible-ssh-%h-%p-%r fimfcn1 '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible, key=ftwxuktzuptwgsqvjrvadpkstknljlfl] password: " -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ftwxuktzuptwgsqvjrvadpkstknljlfl; /usr/bin/python'"'"'"'"'"'"'"'"' && sleep 0'"'"''
fatal: [fimfcn1]: FAILED! => {
    "failed": true, 
    "msg": "Timeout (12s) waiting for privilege escalation prompt: "
}


Any other idea I could go about? That error comes fairly early I have to say too, it isn't waiting that long.

Brian Coca

unread,
Mar 23, 2017, 9:47:07 AM3/23/17
to Ansible Project
Also note that the 'displayed' timeout (12s) is the default value, not
inferred from ssh_args.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages