getting error [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source

426 views
Skip to first unread message

baktavar baba

unread,
Oct 25, 2018, 7:09:19 PM10/25/18
to Ansible Project
Hi i installed Ansible on MacOS and getting below errors

> ansible all -m ping

 [WARNING]: Unable to parse /etc/ansible/hosts 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'



> ansible --version

ansible 2.7.0

  config file = None

  configured module search path = ['/Users/bhaktavar_baba/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']

  ansible python module location = /usr/local/Cellar/ansible/2.7.0/libexec/lib/python3.7/site-packages/ansible

  executable location = /usr/local/bin/ansible

  python version = 3.7.0 (default, Oct 25 2018, 15:05:47) [Clang 10.0.0 (clang-1000.11.45.2)]


But when i check /etc/ansible/hosts getting below error. Is it something wrong with installation procedure i followed?


 > ls -l /etc/ansible/hosts

ls: /etc/ansible/hosts: No such file or directory


Matt Martz

unread,
Oct 25, 2018, 7:28:05 PM10/25/18
to ansible...@googlegroups.com
The pip method of installation doesn't not create the /etc/ansible nor any default files that go there.

OS packages will often do so.

This is not a problem, that just happens to be a default place to look for a things, but you can configure other paths using an ansible.cfg file or via the CLI, or create those paths/files yourself.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f5fe3d7f-a8f5-4661-8394-56a6a0c96a9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages