Dynamic inventory using VMware vSphere

Hi everyone,

We’ve been using Ansible since v2.1 and using static inventory since then. At v2.7 now. The infra has grown quite a lot and we would like to use dynamic inventory.

I tried the configuration as it says here https://docs.ansible.com/ansible/2.7/vmware/vmware_inventory.html and it works fine.

But, as we have been using an static inventory (ini files) and make an extensive use of the group variables (aka group_vars) I was wondering if there is some way to match the dynamic inventory hosts with using the existing group_vars.

I’ve seen that in the inventory file there are just the hosts with some tags or facts coming from vCenter. All the variables we have defined in the group_vars that are mapped with the static inventory files doesn’t work because they name does not match anymore.

Is this the way to go? How we can mimic the way we were using Ansible using dynamic inventory? Do we have to rethink how we use the inventory? if so, how? Any useful link about this topic?

Thank you!

Vicenç