mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 15:11:23 -07:00
avoid errors when dynamic role
This commit is contained in:
parent
4ce0cf57b6
commit
7d9d009189
1 changed files with 1 additions and 5 deletions
|
@ -416,14 +416,10 @@ class TaskExecutor:
|
||||||
include_file = templar.template(include_file)
|
include_file = templar.template(include_file)
|
||||||
return dict(include=include_file, include_variables=include_variables)
|
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
|
# 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':
|
elif self._task.action == 'include_role':
|
||||||
include_variables = self._task.args.copy()
|
include_variables = self._task.args.copy()
|
||||||
role = templar.template(self._task._role_name)
|
return dict(include_role=self._task, include_variables=include_variables)
|
||||||
if not role:
|
|
||||||
return dict(failed=True, msg="No role was specified to include")
|
|
||||||
return dict(include_role=role, include_variables=include_variables)
|
|
||||||
|
|
||||||
# Now we do final validation on the task, which sets all fields to their final values.
|
# Now we do final validation on the task, which sets all fields to their final values.
|
||||||
self._task.post_validate(templar=templar)
|
self._task.post_validate(templar=templar)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue