This error is because the section named “inventory” in the ansible.cfg file is commented out. The steps below are ways to resolve the issue.
Solution: Access the following path in order to modify the ansible.cfg file as shown below C:\cygwin64\etc\ansible
Empty Hosts List Warning
Next, open the file with any of your favourite text editor. I will be using notepad++
– Uncomment the “inventory” out and
– Save the file (Do not forget to save 🙂 )
You can also use VIM as shown below. When you are done, ensure you save and quit with the following command as shown in the screenshot below.
Note: The host is present in the host file as well. For how to setup Ansible on Windows, see the following link .
I hope you found this blog post on Empty Hosts List Warning helpful. Please let me know in the comment session if you have any questions.