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 \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 \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