Cant use installed inventory plugins - awx redirects to auto plugin

Hi!

I’m trying to create dynamic inventories to manage ESX Hosts & VMs. I’ve created a custom execution environment to use the vmware.vmware collection plugins. Even though I declared the plugin in the source variables when syncing the inventory, AWX parses it with the auto plugin. It gathered only VMs information although tried with plugin: vmware.vmware.esxi_hosts.

process inventory source ‘/runner/inventory/vmware_vm_inventory.yml’, I thought the file name might be causing that issue.

ansible-collections-vmware-vmware-vms-inventory
Uses any file which ends with vms.yml, vms.yaml, vmware_vms.yml, or vmware_vms.yaml as a YAML configuration file.

Thanks in advance for any recommendation.

PS: vmware.vmware modules works fine when I tried with job templates.

Job output:

ansible-inventory [core 2.20.1]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/usr/local/lib/python3.12/site-packages/ansible_collections/vmware/vmware/plugins/modules', '/usr/local/lib/python3.12/site-packages/ansible_collections/vmware/vmware_rest/plugins/modules', '/usr/local/lib/python3.12/site-packages/ansible_collections/community/vmware/plugins/modules', '/usr/local/lib/python3.12/site-packages/ansible_collections/community/proxmox/plugins/modules', '/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
  ansible collection location = /usr/local/lib/python3.12/site-packages/ansible_collections:/root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible-inventory
  python version = 3.12.12 (main, Jan  8 2026, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-14)] (/usr/bin/python3.12)
  jinja version = 3.1.6
  pyyaml version = 6.0.3 (with libyaml v0.2.5)
Using /etc/ansible/ansible.cfg as config file

Using inventory plugin 'vmware_vm_inventory' to process inventory source '/runner/inventory/vmware_vm_inventory.yml'
Parsed /runner/inventory/vmware_vm_inventory.yml inventory source with auto plugin

ansible.cfg:

[inventory]
enable_plugins=vmware.vmware.vms, vmware.vmware.esxi_hosts, ost_list, script, auto, yaml, ini, toml

ansible-galaxy collection list | grep vmware
community.vmware                         6.1.0
vmware.vmware                            2.6.0
vmware.vmware_rest                       4.9.0
community.vmware                         4.4.0

version: AWX 24.6.1

Does your inventory YAML file contain plugin: vmware.vmware.vms?

While this is shown in the examples of the vmware.vmware.vms inventory plugin, its “Parameters” documentation unfortunately does not mention it. This field should be set for every plugin to the plugin’s FQCN, and is used by the auto plugin to determine which plugin to use (this is mentioned in the ansible.builtin.auto plugin’s docs).

Other inventory plugins explicity mention this as a required parameter for this reason, for example:

1 Like

The inventory file is named incorrectly. It does not end in one of the required suffixes


I tried again on cli with required inventory file name, there is nothing wrong about execution environment or collection dependencies. Worked fine with simple config.

---
plugin: vmware.vmware.esxi_hosts
hostname: 10.65.223.31
username: administrator@vsphere.local
password: Esxi@123$%
validate_certs: false


The problem occures when it’s come to create dynamic AWX inventory. I created an inventory and added vCenter source. Then I added plugin as source variable but it ignores when syncing inventory. As I mentioned before it uses “vmware_vm_inventory” with auto plugin, so I didn’t define or altered the “.yml” file name, it’s automatically created as “/runner/inventory/vmware_vm_inventory.yml”

Oh I see. Sorry for the misunderstanding.

I think your issues is that the builtin vcenter inventory source in AWX is using the community.vmware plugin, and not the vmware.vmware plugin

1 Like

I just did some quick googling and the builtin vcenter source still uses the community plugin in the latest AAP docs.

You would need to setup a custom inventory source to leverage the VMware.vmware inventories. I hope this helps

If I could use the plugin that I declared from the GUI, it would have been much easier, but I will review other options. Thanks for your kind support. I created dynamic ESX host inventory using awx.awx.inventory and community.vmware plugins before, but it’s not handy.

I tested all vmware inventory in production all is Ok with the last version of plugins and awx.

As mentionned before, if you use :

plugin: vmware.vmware.vms

You need to have a inventory file end with vms.yml, vms.yaml, vmware_vms.yml, or vmware_vms.yaml for vm :source (plugins have some verify function)
and esxi_hosts.yml, esxi_hosts.yaml, vmware_esxi_hosts.yml, or vmware_esxi_hosts.yaml for esxi source

Do not forget in you awx to specify a EE with the plugins installed.

I think you should do like this :

  1. Create a VMware vCenter credential type (native awx) (Specify vcenter hostname)
  2. Create a inventory file in a project with the name : esxi_hosts.yaml containing :
plugin: vmware.vmware.esxi_hosts
validate_certs: false

If your project is on git, do not forget to update your project on awx.

  1. Create a empty inventory
  2. Add a source to your inventory
    Select sources : From project
    Specidy your EE with vmware.vmware plugin and your cred.
    Specify you path to inventory file (AWX do not list YML file for inventory … so you need to be sure)
    Save and Sync !

For VMS inventory you got 2 opiotns : Same as ESXI Host or AWX native with Source Type : VMware Vcenter, select your cred created before and “voila” !
You can filter from source variable, redhat do a nice tutorial here

If you got trouble, ping me, i will screen my config