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 :
---
- 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 :
[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 :
[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,
You have a syntax error in your playbook.
---
- hosts: webservers
vars:
http_port: 80
max_clients: 200
See: https://docs.ansible.com/ansible/playbooks_intro.html
---
- hosts: all
remote_user: root
tasks:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With