u/GushingGranny39

Hi

i got an Ansible AWX (24.6.1) setup at work with a scheduled import of all servers from our vcenter, using the build in vcenter source. The source for the inventory is setup with pretty much all default values except for one source variable.

hostnames: [config.name]

My issue is that some of our vms have multiple nics but Ansible can only reach them on one specific nic. Ansible has no access to the other vlans.

It appears to be a bit random which ip makes it to the ansible_host variable on import.

In this case it should be 10.2.3.242 not 192.168.130.242

https://preview.redd.it/0a39ubp589zg1.png?width=525&format=png&auto=webp&s=7fbc91c16d2e36b1dc5fe338cc083512fb559db0

https://preview.redd.it/nu0pce3689zg1.png?width=538&format=png&auto=webp&s=7d1ea135e3825e3624777694afb67c297201aae3

What would be the best solution for this?

I cannot manually overwrite the variable after import, because they will be overwritten on the next scheduled import. The 10.x adress is the first nic of the vm. Switching nics around in vcenter doesn't seem to have an impact. To me it feels random which ip get choosen.

reddit.com
u/GushingGranny39 — 18 days ago