Hello Everyone,
I am trying to add network adaptor to vmware virtual machine, but while 
executing playbook i am getting below error.

Please help me to resolve this issue.

Note: we are process in to upgrade ansible & python version so please 
ignore warring message in log 
## 
ansible 2.9.7
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Sep 26 2019, 13:23:47) [GCC 4.8.5 
20150623 (Red Hat 4.8.5-39)]
=================================================================================================
---
- name: add nic
  hosts: localhost
  connection: local
  tasks:
  - name: Add nic2 on vm
    vmware_guest_network:
      hostname: "{{ vcenter_hostname }}"
      username: "{{ vcenter_username }}"
      password: "{{ vcenter_password }}"
      datacenter: "DC1"
      cluster: "VC1"`"
      validate_certs: no
      name: "{{ nodename }}"
      gather_network_info: false
      networks:
        - name: "dvPortGroup_203"
          dvswitch_name: "DVS_DC1"
          connected: True
          state: new
          device_type: vmxnet3
          start_connected: true
    delegate_to: localhost
    register: nic_attch
  - debug: var=nic_attach
=================================================================================================
fatal: [localhost -> localhost]: FAILED! => {"changed": false, 
"module_stderr": 
"/home/ansible/.local/lib/python2.7/site-packages/requests/__init__.py:91: 
RequestsDependencyWarning: urllib3 (1.22) or chardet (2.2.1) doesn't match 
a supported version!\n  RequestsDependencyWarning)\nTraceback (most recent 
call last):\n  File 
\"/home/ansible/.ansible/tmp/ansible-tmp-1603297067.7-41941-192965455067943/AnsiballZ_vmware_guest_network.py\",
 
line 102, in <module>\n    _ansiballz_main()\n  File 
\"/home/ansible/.ansible/tmp/ansible-tmp-1603297067.7-41941-192965455067943/AnsiballZ_vmware_guest_network.py\",
 
line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, 
ANSIBALLZ_PARAMS)\n  File 
\"/home/ansible/.ansible/tmp/ansible-tmp-1603297067.7-41941-192965455067943/AnsiballZ_vmware_guest_network.py\",
 
line 40, in invoke_module\n    
runpy.run_module(mod_name='ansible.modules.cloud.vmware.vmware_guest_network', 
init_globals=None, run_name='__main__', alter_sys=True)\n  File 
\"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\n    fname, 
loader, pkg_name)\n  File \"/usr/lib64/python2.7/runpy.py\", line 82, in 
_run_module_code\n    mod_name, mod_fname, mod_loader, pkg_name)\n  File 
\"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\n    exec code in 
run_globals\n  File 
\"/tmp/ansible_vmware_guest_network_payload_eOLChh/ansible_vmware_guest_network_payload.zip/ansible/modules/cloud/vmware/vmware_guest_network.py\",
 
line 526, in <module>\n  File 
\"/tmp/ansible_vmware_guest_network_payload_eOLChh/ansible_vmware_guest_network_payload.zip/ansible/modules/cloud/vmware/vmware_guest_network.py\",
 
line 518, in main\n  File 
\"/tmp/ansible_vmware_guest_network_payload_eOLChh/ansible_vmware_guest_network_payload.zip/ansible/modules/cloud/vmware/vmware_guest_network.py\",
 
line 474, in reconfigure_vm_network\n  File 
\"/tmp/ansible_vmware_guest_network_payload_eOLChh/ansible_vmware_guest_network_payload.zip/ansible/module_utils/vmware.py\",
 
line 82, in wait_for_task\n  File 
\"/tmp/ansible_vmware_guest_network_payload_eOLChh/ansible_vmware_guest_network_payload.zip/ansible/module_utils/six/__init__.py\",
 
line 748, in raise_from\nansible.module_utils.vmware.TaskError: ('The 
object or item referred to could not be found.', None)\n", "module_stdout": 
"", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
=================================================================================================

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7d6ff50e-dbf3-4d69-939f-a6c2e5dec3abn%40googlegroups.com.

Reply via email to