Usually I am warm and comfy in my vCenters, but someone asked me to help them with their “put the show on the road” server.
We are trying to run our automation against a non-paid vSphere box, and I am trying to get inventory data off it, because I have some dependencies on data that comes from the inventory plugins.
I know this is probably something simple, dealing with the vSphere server. It’s the first time we’ve ever tried to run against the system. It’s basically shut down most of the year.
Here is my plugin config…
plugin: vmware_vm_inventory
strict: false
cache: true
cache_connection: /srv/inv/cache_that_stuff
hostname: somethin.somethin.local
username: someuser
password: someP@ssword
validate_certs: false
hostnames:
- config.name
properties:
- name
- config.cpuHotAddEnabled
- config.cpuHotRemoveEnabled
- config.instanceUuid
- config.hardware
- config.template
- config.name
- config.uuid
- guest.hostName
- guest.ipAddress
- guest.ipStack
- guest.guestId
- guest.guestState
- guest.net
- guest.disk
- runtime.maxMemoryUsage
- customValue
- summary.runtime.powerState
- config.guestId
- summary.customValue
- storage
- snapshot
- datastore
groups:
windows: "'windows' in config.guestId"
linux: "'windows' not in config.guestId"
upgrade: true
conf: true
prod: true
has_snapshots: snapshot is defined
keyed_groups:
- key: summary.runtime.powerState
separator: ""
- key: cu_group
parent_group: cus
- key: tag_category.status
separator: ""
- key: tag_category.stec_role
separator: ""
- key: guest.hostName | regex_replace('^[^.]*[.]','') | regex_replace('[.].*$','')
separator: ""
leading_separator: false
with_path: true
with_tags: true
compose:
gateway: (guest.ipStack[0].ipRouteConfig.ipRoute | selectattr('network', 'eq', '0.0.0.0') | first).gateway.ipAddress
ansible_host: guest.ipAddress
prefix_length: (guest.net[0].ipConfig.ipAddress | selectattr('state', 'eq', 'preferred')
And here is the output.
[WARNING]: * Failed to parse /home/gzelt/awx/conf/conf.vmware.yml with auto plugin: Failed to login to 192.168.222.105:443 using ansible due to
: {messages : [LocalizableMessage(id='vapi.provider.interface.unknown', default_message='Unknown interface: com.vmware.cis.session',
args=['com.vmware.cis.session'], params=None, localized=None)], data : None, error_type : None}
File "/home/gzelt/.local/lib/python3.10/site-packages/ansible/inventory/manager.py", line 293, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/home/gzelt/.local/lib/python3.10/site-packages/ansible/plugins/inventory/auto.py", line 59, in parse
plugin.parse(inventory, loader, path, cache=cache)
File "/home/gzelt/.ansible/collections/ansible_collections/community/vmware/plugins/inventory/vmware_vm_inventory.py", line 677, in parse
self.pyv.do_login()
File "/home/gzelt/.ansible/collections/ansible_collections/community/vmware/plugins/inventory/vmware_vm_inventory.py", line 436, in do_login
self.rest_content = self._login_vapi()
File "/home/gzelt/.ansible/collections/ansible_collections/community/vmware/plugins/inventory/vmware_vm_inventory.py", line 467, in _login_vapi
raise AnsibleError(msg)
I think it is likely that we haven’t installed something or turned something on for the vSphere server. Again, it’s rarely ever used.