"Host declaration is required" error while hosts are (seemingly) defined.

Not sure why, but I get this error while trying to run my first playbook…

[wes@mgmt001 playbooks]$ ansible-playbook nrpe.yml

PLAY [all] ****************************
SETUP PHASE ****************************
ok: [testansible.dal05.domain.com]
ERROR: hosts declaration is required

I’m new to yaml, but I don’t understand why I’m experiencing this issue (and Ansible seems to get the ‘testansible’ host, at least partially).

A playbook is a list of plays. Each list item starts with a “-”, and each play must have a host declaration.

You started a new play with the “-” before tasks. Keep tasks at the same level with hosts and users and it will be fine.

–Michael

That now makes sense. Thanks!