Reputation: 528
I want to run the ansible setup module, by declaring a specific host.
I am using Windows 10 machine , with windows subsystem for linux where ansible is installed.
I can run the setup module when using localhost, ie:
ansible localhost -m setup
I can run it when using the ansible.cfg file I use from one virtual environment, against a virtual machine ie:
ansible TestVm -m setup
In another virtual environment i have installed ansible without setting up an ansible.cfg file, and my hosts.yml file is in the windows (not the WSL filesystem).
No matter which directory i switch, I cannot run the setup module using for instance:
ansible -i inventory -m setup
.
Is there a way to run setup without a configuration file and if yes what part of the call am i missing?
Upvotes: 3
Views: 480
Reputation: 461
Try this:
ansible all -i inventory -m setup
Where the inventory is a directory with at least the hosts.yml file.
And this an example of hosts.yml
all:
hosts:
192.168.2.9:
192.168.2.3:
192.168.2.4:
Also before any of these you must have added pywinrm:
pip install pywinrm
Upvotes: 2