Open jcosmao opened 4 years ago
I just ran into this, too. I'd really like to see support for SSH retries. I often run playbooks with tons of hosts, and often enough the first SSH connection to some of them fails (for whatever reason). Using Ansible's default SSH connection plugin with retries solves this as the second connection attempt works for those few hosts, but with the mitogen plugin no retries are made.
I'd be very grateful if support for ANSIBLE_SSH_RETRIES
/ [ssh_connection] retries=…
was implemented.
Have there been any work arounds or updates on this issue? In our use case we have connection issues based on ping and would like to retry some of those hosts as well. Prior to using mitogen, we weren't experiencing this issue.
I'm seeing the same thing with none of this configuration not being used:
[ssh_connection]
ansible_ssh_timeout = 60s
ssh_args=-o PasswordAuthentication=no -o ConnectTimeout=60s -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p-%r
Nevermind, that configuration does get used, but I get this error:
[mux 787] 03:25:53.163826 D mitogen.parent: failing connection ssh.importer.staging.rsrchx.local
due to TimeoutError('Failed to setup connection after 10.00 seconds')
How do you set the Connection.options.connect_timeout
value that's used in Connection._on_timer_expired()
as shown in the above error message?
Which version of Ansible are you running? ansible==2.9.1 mitogen==0.2.9
Is your version of Ansible patched in any way? no
Are you running with any custom modules, or
module_utils
loaded? noHave you tried the latest master version from Git? no
Do you have some idea of what the underlying problem may be? https://mitogen.networkgenomics.com/ansible_detailed.html#common-problems has instructions to help figure out the likely cause and how to gather relevant logs.
Mention your host and target OS and versions ubuntu 16.04
Mention your host and target Python versions python 3.5
It seems mitogen does not retry ssh connection if a host is unreachable. Trying to reproduce issue with an unreachable host and ssh retries setup to 5:
ansible.cfg
Play
Logs
with strategy: linear
with strategy: mitogen_linear