From ffd117132f7d61a154fb95723f11262c59c63c6d Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Thu, 20 Jun 2019 09:17:50 -0500 Subject: [PATCH] Create new instance of the action plugin per until iteration. Fixes #57886 (#58022) --- changelogs/fragments/te-new-action-until.yml | 3 +++ lib/ansible/executor/task_executor.py | 1 + 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/te-new-action-until.yml diff --git a/changelogs/fragments/te-new-action-until.yml b/changelogs/fragments/te-new-action-until.yml new file mode 100644 index 00000000000..3caa3dadd1d --- /dev/null +++ b/changelogs/fragments/te-new-action-until.yml @@ -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) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index bb439565bc6..fe10d0a5617 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -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