From d97d36c57d2772656bb0828df32d27e2180d8419 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Thu, 25 Jan 2018 11:17:36 -0500 Subject: [PATCH] Enabled ssh retries for ansible Adds the option to retry failed ssh executions if the failure is encountered in ssh itself, not the remote command. This can be helpful if there are transient network issues. Set to 3 attempts, currently unable to override this setting. A future patch could expose it to end users. http://docs.ansible.com/ansible/latest/intro_configuration.html#retries Change-Id: I9a583e49253e3713f69981c4981369e4d35aaedd Signed-off-by: Paul Belanger --- zuul/executor/server.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zuul/executor/server.py b/zuul/executor/server.py index a8ab8c45e6..5caa8806ce 100644 --- a/zuul/executor/server.py +++ b/zuul/executor/server.py @@ -1261,6 +1261,9 @@ class AnsibleJob(object): config.write('internal_poll_interval = 0.01\n') config.write('[ssh_connection]\n') + # NOTE(pabelanger): Try up to 3 times to run a task on a host, this + # helps to mitigate UNREACHABLE host errors with SSH. + config.write('retries = 3\n') # NB: when setting pipelining = True, keep_remote_files # must be False (the default). Otherwise it apparently # will override the pipelining option and effectively