diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index ab6915dee6..13b7d24bc9 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -794,7 +794,14 @@ class TaskExecutor: conn_type = self._play_context.connection - connection = self._shared_loader_obj.connection_loader.get(conn_type, self._play_context, self._new_stdin, ansible_playbook_pid=to_text(os.getppid())) + connection = self._shared_loader_obj.connection_loader.get( + conn_type, + self._play_context, + self._new_stdin, + task_uuid=self._task._uuid, + ansible_playbook_pid=to_text(os.getppid()) + ) + if not connection: raise AnsibleError("the connection plugin '%s' was not found" % conn_type)