Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vmware_guest_info: Failed to gather information with vSphere Schema #33

Closed
Akasurde opened this issue Mar 4, 2020 · 4 comments · Fixed by #36
Closed

vmware_guest_info: Failed to gather information with vSphere Schema #33

Akasurde opened this issue Mar 4, 2020 · 4 comments · Fixed by #36
Assignees
Labels
bug This issue/PR relates to a bug verified This issue has been verified/reproduced by maintainer

Comments

@Akasurde
Copy link
Member

Akasurde commented Mar 4, 2020

SUMMARY

While working with the New Ansible Module: "vmware_guest_info" with Ansible Version
While trying to get the Mac Address or the IP Address from the guest_info

ansible 2.9.4
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.17 (default, Nov  7 2019, 10:07:09) [GCC 9.2.1 20191008]
---
- hosts: localhost
  gather_facts: false
  tasks:
  - vmware_guest_info:
      hostname: 
      username: 
      password: 
      validate_certs: no
      datacenter: Test
      name: win201
      schema: "vsphere"
      properties: ["config.hardware.device.deviceInfo.summary"]
    delegate_to: localhost
    register: vminfo
  - debug:
      var: vminfo

JSON File:

"hardware": {
                   "_vimtype": "vim.vm.VirtualHardware",
                   "device": [
                       {
                           "_vimtype": "vim.vm.device.VirtualE1000",
                           "addressType": "assigned",
                           "backing": {
                               "_vimtype": "vim.vm.device.VirtualEthernetCard.NetworkBackingInfo",
                               "deviceName": "-POC",
                               "inPassthroughMode": null,
                               "network": "vim.-7017",
                               "useAutoDetect": false
                           },
                           "controllerKey": 100,
                           "deviceInfo": {
                               "_vimtype": "vim.Description",
                               "label": "Network adapter 1",
                               "summary": "-POC"
                           },
                           "externalId": null,
                           "key": 4000,
                           "macAddress": "00"


ISSUE TYPE

I'm getting the following Error :

fatal: [localhost -> localhost]: FAILED! => {"changed": false, "msg": "Information gathering failed with exception list indices must be integers, not str"}

@Akasurde
Copy link
Member Author

Akasurde commented Mar 4, 2020

Migrated from ansible/ansible#68010

@Akasurde
Copy link
Member Author

Akasurde commented Mar 4, 2020

cc @dfoley84

@Akasurde Akasurde changed the title Vmware Guest vmware_guest_info: Failed to gather information with vSphere Schema Mar 4, 2020
@Akasurde Akasurde self-assigned this Mar 4, 2020
@Akasurde Akasurde added the needs_triage Needs a first human triage before being processed. label Mar 4, 2020
Akasurde added a commit to Akasurde/community.vmware that referenced this issue Mar 5, 2020
Handle list items in vSphere schema while handling facts in vmware_guest_info

Fixes: ansible-collections#33

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@Akasurde
Copy link
Member Author

Akasurde commented Mar 5, 2020

resolved_by_pr #36

@Akasurde
Copy link
Member Author

Akasurde commented Mar 5, 2020

@dfoley84, Could you please check PR #36 and let us know if it works for you ?

Please check How to test a PR for more help.

Thanks.

needs_info

@Akasurde Akasurde added bug This issue/PR relates to a bug verified This issue has been verified/reproduced by maintainer and removed needs_triage Needs a first human triage before being processed. labels Mar 5, 2020
Akasurde added a commit to Akasurde/community.vmware that referenced this issue Mar 6, 2020
Handle list items in vSphere schema while handling facts in vmware_guest_info

Fixes: ansible-collections#33

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@ansible-zuul ansible-zuul bot closed this as completed in #36 Mar 9, 2020
misacek007 pushed a commit to misacek007/vmware that referenced this issue Jun 5, 2020
Handle list items in vSphere schema while handling facts in vmware_guest_info

Fixes: ansible-collections#33

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
phsmith pushed a commit to phsmith/vmware that referenced this issue Jul 6, 2020
Handle list items in vSphere schema while handling facts in vmware_guest_info

Fixes: ansible-collections#33

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
machacekondra pushed a commit to machacekondra/vmware.vmware that referenced this issue Mar 8, 2024
Handle list items in vSphere schema while handling facts in vmware_guest_info

Fixes: ansible-collections/community.vmware#33

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>

This commit was initially merged in https://github.com/ansible-collections/community.vmware
See: ansible-collections/community.vmware@6a4fe4f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug verified This issue has been verified/reproduced by maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant