# ERROR! 'with\_indexed\_items' is not a valid attribute for a Play

**URL:** <https://forum.ansible.com/t/error-with-indexed-items-is-not-a-valid-attribute-for-a-play/26159>\
**Category:** Ansible Project\
**Created:** [November 28, 2017, 9:20pm UTC](https://forum.ansible.com/t/error-with-indexed-items-is-not-a-valid-attribute-for-a-play/26159 "2017-11-28T21:20:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markus\_Iser](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Markus\_Iser](https://forum.ansible.com/u/Markus_Iser)\
**Post date:** [November 28, 2017, 9:20pm UTC](https://forum.ansible.com/t/error-with-indexed-items-is-not-a-valid-attribute-for-a-play/26159/1 "2017-11-28T21:20:23Z")

</div>

Hello, I just gave myself a crashcourse in Ansible in order to setup a cluster at my university.  
As I was eager to just do anything with Ansible I running through a rather complicated bootstrapping.  
Now that I’m testing the final result, the bootstrapping is just broken.  
It seems like the hosts file (that I store just next to my playbooks) is not recognized (I think this can be fixed by putting it somewhere global),  
but what really is a greater problem ist, that it seems that ‘with\_indexed\_items’ does not work as expected.  
Am I just using it wrong?

ansible --version

ansible 2.4.1.0

ansible-playbook main.yml

[WARNING]: Could not match supplied host pattern, ignoring: all  
[WARNING]: provided hosts list is empty, only localhost is available  
ERROR! ‘with\_indexed\_items’ is not a valid attribute for a Play  
The error appears to have been in ‘/amd.home/home/i12/iser/git/acamar/ansible/phase-0.yml’: line 2, column 3, but may  
be elsewhere in the file depending on the exact syntax problem.  
The offending line appears to be:

---

<div class="post-metadata">

**Author:** ![Markus\_Iser](https://avatars.discourse-cdn.com/v4/letter/m/ba8739/32.png) [@Markus\_Iser](https://forum.ansible.com/u/Markus_Iser)\
**Post date:** [November 28, 2017, 10:24pm UTC](https://forum.ansible.com/t/error-with-indexed-items-is-not-a-valid-attribute-for-a-play/26159/2 "2017-11-28T22:24:34Z")

</div>

Okay I got it, sorry for the spam, seems that I confused the hierarchy of playbooks and roles in phase-0.yml. Playbooks my only contain tasks after the keyword “task:”, not so for roles, however…
