From 7d9d00918966a4741cfc04c0c532207fed8651bb Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 14 Oct 2016 18:03:13 -0400 Subject: [PATCH] avoid errors when dynamic role --- lib/ansible/executor/task_executor.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 640a54f4d64..bfd698038c5 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -416,14 +416,10 @@ class TaskExecutor: include_file = templar.template(include_file) return dict(include=include_file, include_variables=include_variables) - # TODO: not needed? # 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() - role = templar.template(self._task._role_name) - if not role: - return dict(failed=True, msg="No role was specified to include") - return dict(include_role=role, include_variables=include_variables) + return dict(include_role=self._task, 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)