Ansible – ERROR! the field ‘hosts’ is required but was not set

Question:

I’ve an error when I launch a playbook but I don’t found why….

ERROR! the field ‘hosts’ is required but was not set

There is my main.yml :

And my /etc/ansible/hosts :

When I test a ping, all is good :

Please, help me 🙂
Regards,

Answer:

You have a syntax error in your playbook.

See: https://docs.ansible.com/ansible/playbooks_intro.html

Leave a Reply