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 :
1 2 3 4 5 6 7 8 9 10 11 12 |
--- - hosts: hosts - vars: - elasticsearch_java_home: /usr/lib/jmv/jre-1.7.0 - elasticsearch_http_port: 8443 - tasks: - include: tasks/main.yml - handlers: - include: handlers/main.yml |
And my /etc/ansible/hosts :
1 2 3 4 5 6 |
[hosts] 10.23.108.182 10.23.108.183 10.23.108.184 10.23.108.185 |
When I test a ping, all is good :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[root@poste08-08-00 elasticsearch]# ansible hosts -m ping 10.23.108.183 | SUCCESS => { "changed": false, "ping": "pong" } 10.23.108.182 | SUCCESS => { "changed": false, "ping": "pong" } 10.23.108.185 | SUCCESS => { "changed": false, "ping": "pong" } 10.23.108.184 | SUCCESS => { "changed": false, "ping": "pong" } |
Please, help me 🙂
Regards,
Answer:
You have a syntax error in your playbook.
1 2 3 4 5 6 |
--- - hosts: webservers vars: http_port: 80 max_clients: 200 |