Create new instance of the action plugin per until iteration. Fixes #57886 (#58022)

This commit is contained in:
Matt Martz 2019-06-20 09:17:50 -05:00 committed by GitHub
parent 375ac76e58
commit ffd117132f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1,3 @@
bugfixes:
- TaskExecutor - Create new instance of the action plugin on each
iteration when using until (https://github.com/ansible/ansible/issues/57886)

View file

@ -729,6 +729,7 @@ class TaskExecutor:
display.debug('Retrying task, attempt %d of %d' % (attempt, retries))
self._final_q.put(TaskResult(self._host.name, self._task._uuid, result, task_fields=self._task.dump_attrs()), block=False)
time.sleep(delay)
self._handler = self._get_action_handler(connection=self._connection, templar=templar)
else:
if retries > 1:
# we ran out of attempts, so mark the result as failed