I have a VMware vCenter with several VMs. I want to use ansible to configure the network interfaces of the guest based on the network to which the VMware network interface is connected. Since the network interface names in the guest may not be named in a stable way, I want to match it based on the mac-address, which is known inside and outside the VM.
For that I want to gather information from VMware vCenter for each VM, which leads to the first question: Since the needed information is tightly coupled to the VM, should I write a *_facts (and no *_info) module for that?
Since this module code directly contacts the vCenter API, there is no need to execute the code on the target host, which leads to the 2nd question: Is there a way to always execute a module locally? (Without using delegate_to in the playbook)
And the last question: Is it possible to execute *_facts modules automatically, without explicitly referencing them in a playbook?