ERROR! 'with_indexed_items' is not a valid attribute for a Play

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:

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…