0
I created an inventory file has .yml extension like below:
---
all:
server1
hosts:
server2
children:
hana:
prod:
client1:
hosts:
server3
client2:
hosts:
server4
test:
client1:
hosts:
server5
client1:
hosts:
server6
...
Then I ran ping ad-hoc for all hosts with below command:
ansible -m ping -i /etc/ansible/inventories/linuxall.yml all
And I saw these warnings and ping didn't work:
[WARNING]: Unable to parse /etc/ansible/inventories/linuxall.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
Why ansible cannot parse my inventory? Should I do anything for this?
thanks. I saw this tutorial. I found the the reason of the problem. I'll add an solution asap. It's not about the file, it's about config file. – Gefolge – 2019-10-14T13:52:24.750