From c30ee42fe1f0a9666a90f4d63121780f2a186c54 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Thu, 4 Jan 2018 08:23:35 -0600 Subject: [PATCH] Don't use the Task object in the dictionary of results for include_role The short-circuiting of include_role in TaskExecutor was using the _task object in the result dictionary. This causes the playbook class to be serialized, which is something we no longer do due to speed/size problems with nested objects. Simply removing this should fix a lot of memory and speed problems with include_role. --- lib/ansible/executor/task_executor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 5e0f34599a..a93a76c250 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -463,7 +463,7 @@ class TaskExecutor: # if this task is a IncludeRole, we just return now with a success code so the main thread can expand the task list for the given host elif self._task.action == 'include_role': include_variables = self._task.args.copy() - return dict(include_role=self._task, include_variables=include_variables) + return dict(include_variables=include_variables) # Now we do final validation on the task, which sets all fields to their final values. self._task.post_validate(templar=templar)