I'm trying to simply connect to a machine and run the win_ping module.
There are several tutorials online that outline a few key steps:
- Create a directory
./windows
- Create a file
hosts
in./windows
- Create a directory
./windows/group_vars
- Create a file
windows.yml
in./windows/group_vars
- Insert several variables with your Windows credentials into
windows.yml
The problem is that none of these actually specify where to put these relative to the '.'. I've tried placing this structure in /etc/ansible/
and unfortunately it's looking like Ansible isn't picking this up at all. I've also tried moving the structure around but no luck.
How do I get Ansible to reference the directory I've created? I believe ansible.cfg
would make sense but I can only see how to point it to a default inventory file. Interestingly enough - even adding a group called 'windows' in the base hosts file and calling ansible with the group there - it says no hosts found. I have also uncommented the inventory location in ansible.cfg to point to /etc/ansible/hosts
and it still says no hosts found when calling ansible windows -m ping
(or win_ping
for that matter).