diff --git a/test/integration/targets/lookup_indexed_items/tasks/main.yml b/test/integration/targets/lookup_indexed_items/tasks/main.yml index 84f5fbce972..434fe0ff84d 100644 --- a/test/integration/targets/lookup_indexed_items/tasks/main.yml +++ b/test/integration/targets/lookup_indexed_items/tasks/main.yml @@ -14,3 +14,19 @@ - "x2 == 'set'" - "x3 == 'set'" - "x4 == 'set'" + +- block: + - name: "EXPECTED FAILURE - test not a list" + debug: + msg: "{{ item.0 }} is {{ item.1 }}" + with_indexed_items: + "a": 1 + + - fail: + msg: "should not get here" + + rescue: + - assert: + that: + - ansible_failed_task.name == "EXPECTED FAILURE - test not a list" + - ansible_failed_result.msg == "with_indexed_items expects a list"