Inventory from uploaded file

I’m trying to create my inventory from WSUS. For me there are advantages in terms of capturing physical servers that aren’t in vCenter.

I am mostly there. On the WSUS server I have a PowerShell script that exports the list of servers in WSUS to INI and YML files that Ansible can understand. I have a script that uploads the files to Ansible. However, when I tried to use either file as a souce “from poject” it can’t find them.

I tried creating the inventory/wsusfiles/ folder and the inventory files in Visual Studio, and those are found as an inventory source just fine. But clearly when I am uploading the files into what seems to be that folder, it isn’t really going there (I added a dummy server name to the upload file to confirm and it didn’t appear in inventory when I resynced the inventory file).

So, my questions are:

Where am I really uploading to within the project, and it is possible to reference that path as the inventory source? Or is the only way to update the source to modify the file in Visual Studio and sync?

Is there some other source other than “Sourced from Project” I can use to make this work? It seems like “import from file” should be basic functionality, but if I can’t use a file I upload I’m kind of stuck.

Thanks!

Upload file:

Hi,

It’s probably the syntax you are using only works in visual studio for “project source” I would expect it to be the ansible syntax and config for ansible inventory and not visual studio

Here’s the reference:

https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html

https://docs.ansible.com/ansible/latest/inventory_guide/intro_dynamic_inventory.html#intro-dynamic-inventory

https://docs.ansible.com/ansible/latest/cli/ansible-inventory.html

-i, --inventory, --inventory-file[](https://docs.ansible.com/ansible/latest/cli/ansible-inventory.html#cmdoption-ansible-inventory-i)

specify inventory host path or comma separated host list. –inventory-file is deprecated

https://www.digitalocean.com/community/tutorials/how-to-set-up-ansible-inventories

Regards,
S.W