1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Actually check for import_role when loop detected (#39218)

This commit is contained in:
Martin Krizek 2018-04-25 14:50:20 +02:00 committed by GitHub
parent c30f46f7c6
commit 1c49cc4377
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,7 +317,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
if is_static:
if ir.loop is not None:
if 'import_tasks' in task_ds:
if 'import_role' in task_ds:
raise AnsibleParserError("You cannot use loops on 'import_role' statements. You should use 'include_role' instead.", obj=task_ds)
else:
raise AnsibleParserError("You cannot use 'static' on an include_role with a loop", obj=task_ds)