* helpers.py: Fixes #27334 include empty task file within a 'block' disables the complete block * include module: added warning if file without tasks is included
This commit is contained in:
parent
e244deedbd
commit
1fb1793c70
1 changed files with 2 additions and 1 deletions
|
@ -207,7 +207,8 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
|
||||||
try:
|
try:
|
||||||
data = loader.load_from_file(include_file)
|
data = loader.load_from_file(include_file)
|
||||||
if data is None:
|
if data is None:
|
||||||
return []
|
display.warning('file %s is empty and had no tasks to include' % include_file)
|
||||||
|
continue
|
||||||
elif not isinstance(data, list):
|
elif not isinstance(data, list):
|
||||||
raise AnsibleParserError("included task files must contain a list of tasks", obj=data)
|
raise AnsibleParserError("included task files must contain a list of tasks", obj=data)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue