From 63a595bae3f3db85582ddba2d51ad4124877034f Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 16 Nov 2016 11:46:18 -0800 Subject: [PATCH] Don't retry when using synchronize module There is a bug (https://github.com/ansible/ansible/issues/18281) in the ansible synchronize module that causes any retry attempt at synchronizing to fail because the paths get munged resulting in invalid paths. Unfortunately this also means that the error message we get is not for the first failed sync attempt but for the last making it hard to debug why things failed in the first place. Address this by not attempting to retry until ansible is fixed. This way we get accurate error messages more quickly (as we don't retry over and over and generate a bad error message at the end). Change-Id: I545c44b11f37576edc8768a3ed78962ff870995f --- zuul/launcher/ansiblelaunchserver.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/zuul/launcher/ansiblelaunchserver.py b/zuul/launcher/ansiblelaunchserver.py index 49d9bcf931..eeea8f8f51 100644 --- a/zuul/launcher/ansiblelaunchserver.py +++ b/zuul/launcher/ansiblelaunchserver.py @@ -1009,7 +1009,11 @@ class NodeWorker(object): synchronize=syncargs) if not scpfile.get('copy-after-failure'): task['when'] = 'success|bool' - task.update(self.retry_args) + # We don't use retry_args here because there is a bug in + # the synchronize module that breaks subsequent attempts at + # retrying. Better to try once and get an accurate error + # message if it fails. + # https://github.com/ansible/ansible/issues/18281 tasks.append(task) task = self._makeSCPTaskLocalAction( @@ -1084,7 +1088,10 @@ class NodeWorker(object): task = dict(name='copy files from node', synchronize=syncargs, when='success|bool') - task.update(self.retry_args) + # We don't use retry_args here because there is a bug in the + # synchronize module that breaks subsequent attempts at retrying. + # Better to try once and get an accurate error message if it fails. + # https://github.com/ansible/ansible/issues/18281 tasks.append(task) task = dict(name='FTP files to server', shell='lftp -f %s' % ftpscript, @@ -1142,7 +1149,10 @@ class NodeWorker(object): task = dict(name='copy files from node', synchronize=syncargs, when='success|bool') - task.update(self.retry_args) + # We don't use retry_args here because there is a bug in the + # synchronize module that breaks subsequent attempts at retrying. + # Better to try once and get an accurate error message if it fails. + # https://github.com/ansible/ansible/issues/18281 tasks.append(task) afstarget = afs['target'].lstrip('/')