Exceptions with vmware_deploy_ovf module

Skip to first unread message

Vichu

unread,
May 31, 2022, 8:45:55 PM5/31/22
to Ansible Project
hello there,

I am trying to automate the cloud director OVA deployment in our local lab. Built a playbook but caught up with the exception during the execution. Need your advice to unblock from this. 

Error found:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: For "valuepected type str, but got int
fatal: [localhost -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n e \"/root/.ansible/tmp/ansible-tmp-1654025411.9694972-30359-230767769553477/AnsiballZ_vmware_deploy_ovf.py\", line 100 <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1654025411.9694972-30359-230767769553477/AnslZ_vmware_deploy_ovf.py\", line 92, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n   \"/root/.ansible/tmp/ansible-tmp-1654025411.9694972-30359-230767769553477/AnsiballZ_vmware_deploy_ovf.py\", line 41, nvoke_module\n    run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_modn    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 9n _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85,_run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_vmware_deploy_ovf_payload_r7j_7pzv/ansible_vmware_deploy_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_deploy_ovf.py\", line 755, in <module>\n  Fil/tmp/ansible_vmware_deploy_ovf_payload_r7j_7pzv/ansible_vmware_deploy_ovf_payload.zip/ansible_collections/community/vm/plugins/modules/vmware_deploy_ovf.py\", line 743, in main\n  File \"/tmp/ansible_vmware_deploy_ovf_payload_r7j_7pzv/ale_vmware_deploy_ovf_payload.zip/ansible_collections/community/vmware/plugins/modules/vmware_deploy_ovf.py\", line 530 upload\n  File \"/tmp/ansible_vmware_deploy_ovf_payload_r7j_7pzv/ansible_vmware_deploy_ovf_payload.zip/ansible_collecs/community/vmware/plugins/modules/vmware_deploy_ovf.py\", line 443, in get_lease\n  File \"/usr/local/lib/python3.6/spackages/pyVmomi/VmomiSupport.py\", line 663, in __setattr__\n    CheckField(self._GetPropertyInfo(name), val)\n  Fileusr/local/lib/python3.6/site-packages/pyVmomi/VmomiSupport.py\", line 1098, in CheckField\n    % (info.name, info.typeame__, valType.__name__))\nTypeError: For \"value\" expected type str, but got int\n", "module_stdout": "", "msg": "MO FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

Environment Detail:
Package            Version
------------------ ----------
ansible            2.9.0
asn1crypto         1.3.0
certifi            2019.11.28
cffi               1.13.2
chardet            3.0.4
charset-normalizer 2.0.12
cryptography       2.8
dnspython          1.16.0
idna               2.8
Jinja2             2.10.3
jmespath           0.9.4
lxml               4.4.2
MarkupSafe         1.1.1
pip                21.3.1
pycparser          2.19
pyvmomi            7.0.3
PyYAML             5.3
requests           2.22.0
setuptools         39.2.0
six                1.13.0
urllib3            1.25.7

Here is my play book:

    vmware_deploy_ovf:
      hostname: "{{ vcenter_hostname }}"
      username: "{{ vcenter_username }}"
      password: "{{ vcenter_password }}"
      validate_certs: "{{ ova_validate_certs }}"
      name: Auto-VCD-10.3.1
      datacenter: "{{ vcenter_default_datacenter }}"
      cluster: "{{ vcenter_default_cluster }}"
      datastore: nfs-ds
      disk_provisioning: thin
      networks:
        "Network 1": "VM Network"
        #"Network 2": "Network78"
      ova: /OVA/VMware_Cloud_Director.ova
      allow_duplicates: no
      power_on: yes
      fail_on_spec_warnings: yes
      wait: yes
      wait_for_ip_address: yes
      inject_ovf_env: yes
      properties:
        vami.DNS.VMware_vCloud_Director: "{{ dns_server }}"
        vami.domain.VMware_vCloud_Director: "{{ domain name"
        vami.gateway.VMware_vCloud_Director:  "{{ gateway }}"
        vami.ip0.VMware_vCloud_Director: "{{ ip0address }}"
        vami.ip1.VMware_vCloud_Director: "{{ ip1address }}"
        vami.netmask0.VMware_vCloud_Director: "{{ netmask }}"
        vami.netmask1.VMware_vCloud_Director: "{{ netmask }}"
        vami.searchpath.VMware_vCloud_Director: "{{ default_domain }}"
        vcloudapp.varoot-password.VMware_vCloud_Director: "{{ root-passwd }}"
        vcloudconf.admin_fname.VMware_vCloud_Director: admin
        vcloudconf.admin_pwd.VMware_vCloud_Director: "{{ passwd }}"
        vcloudconf.admin_uname.VMware_vCloud_Director: administrator
        vcloudconf.ceip_enabled.VMware_vCloud_Director: True
        vcloudconf.db_pwd.VMware_vCloud_Director: "{{ dbpasswd }}"
        vcloudconf.inst_id.VMware_vCloud_Director: 1
        vcloudconf.sys_name.VMware_vCloud_Director: vCloud
        vcloudnet.routes0.VMware_vCloud_Director: "{{ route1 }}"
        vcloudnet.routes1.VMware_vCloud_Director: "{{ route2 }}"
        vm.vmname: "VMware_vCloud_Director"
    delegate_to: localhost

Dick Visser

unread,
Jun 1, 2022, 12:37:52 AM6/1/22
to ansible...@googlegroups.com
I'd try quoting this 1 and see if that helps



        vcloudconf.sys_name.VMware_vCloud_Director: vCloud
        vcloudnet.routes0.VMware_vCloud_Director: "{{ route1 }}"
        vcloudnet.routes1.VMware_vCloud_Director: "{{ route2 }}"
        vm.vmname: "VMware_vCloud_Director"
    delegate_to: localhost

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/84f849d5-a9ca-4614-90c5-5c7341ce73a9n%40googlegroups.com.
--
Sent from Gmail Mobile

Vichu

unread,
Jun 1, 2022, 1:31:23 AM6/1/22
to Ansible Project
Thanks for the response.  Quote didn't help. 

Any other suggestion would be appreciated. 

Dick Visser

unread,
Jun 1, 2022, 4:13:42 AM6/1/22
to ansible...@googlegroups.com
On Wed, 1 Jun 2022 at 02:46, Vichu <t.v...@gmail.com> wrote:
There are missing brackets here 




        vami.gateway.VMware_vCloud_Director:  "{{ gateway }}"
        vami.ip0.VMware_vCloud_Director: "{{ ip0address }}"
        vami.ip1.VMware_vCloud_Director: "{{ ip1address }}"
        vami.netmask0.VMware_vCloud_Director: "{{ netmask }}"
        vami.netmask1.VMware_vCloud_Director: "{{ netmask }}"
        vami.searchpath.VMware_vCloud_Director: "{{ default_domain }}"
        vcloudapp.varoot-password.VMware_vCloud_Director: "{{ root-passwd }}"
        vcloudconf.admin_fname.VMware_vCloud_Director: admin
        vcloudconf.admin_pwd.VMware_vCloud_Director: "{{ passwd }}"
        vcloudconf.admin_uname.VMware_vCloud_Director: administrator
        vcloudconf.ceip_enabled.VMware_vCloud_Director: True
        vcloudconf.db_pwd.VMware_vCloud_Director: "{{ dbpasswd }}"
        vcloudconf.inst_id.VMware_vCloud_Director: 1
        vcloudconf.sys_name.VMware_vCloud_Director: vCloud
        vcloudnet.routes0.VMware_vCloud_Director: "{{ route1 }}"
        vcloudnet.routes1.VMware_vCloud_Director: "{{ route2 }}"
        vm.vmname: "VMware_vCloud_Director"
    delegate_to: localhost

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/84f849d5-a9ca-4614-90c5-5c7341ce73a9n%40googlegroups.com.

Vichu

unread,
Jun 1, 2022, 2:55:50 PM6/1/22
to Ansible Project
Thanks again for looking into this. Actually, I have hardcoded the values in the actual yaml file whereas here I have given the variable to hide the actual ip and credential info. With that said, that is not the problem here. 

Appreciate your time & help. 

Reply all
Reply to author
Forward
0 new messages