有没有办法 return vmware guest.hostName 作为 ansible_host 而不是 IP 地址

Is there a way to return the vmware guest.hostName as the ansible_host instead of IP Address

我正在尝试将 vmware_vm_inventory 插件用于 ansible 2.9 并连接到 vcenter 以获取动态清单。他们 ansible_host 变量正在填充我主机的 IP 地址,因为他们是 windows 主机,我用 winrm 和 kerberos 连接到他们。 Kerberos 似乎不允许 IP 地址,需要主机名。该插件会 return 变量 guest.hostName 中的主机名。

出现错误:"msg":"kerberos: authGSSClientStep() failed: (('Unspecified GSS failure. Minor code may provide more information', 851968), ('Server not found in Kerberos database', -1765328377))"

如何配置 ansible 和 vmware_vm_inventory 插件以将主机名放入 ansible_host 变量中?

从 Ansible 2.9 开始,vmware_vm_inventory 插件 returns 将 guest.ipAddress 转换为 ansible_host。模块可以修改为使用 guest.hostName

功能请求在这里: https://github.com/ansible/ansible/issues/65678