From 1c49cc4377459d8848cc11c8fea117cdcffcb4d9 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Wed, 25 Apr 2018 14:50:20 +0200 Subject: [PATCH] Actually check for import_role when loop detected (#39218) --- lib/ansible/playbook/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/playbook/helpers.py b/lib/ansible/playbook/helpers.py index 248a840bb05..86c0c14f842 100644 --- a/lib/ansible/playbook/helpers.py +++ b/lib/ansible/playbook/helpers.py @@ -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)