Closed sanosir closed 3 years ago
@snsiregar
Other vmware modules (snapshot and guest) are using the Automation SDK itself or pyvmomi?
@snsiregar Any update?
hello @anusha94 vmware modules using pyvmomi and for right now I did not use tag_names and using annotation instead.
I found same problem when I tried to tag vCenter VM´s with this module. I have SDK automation installed for python3 and I am running this job with python3 interpreter. any solution for this?
error
File "/tmp/ansible_vmware_tag_manager_payload_kej2cwnr/ansible_vmware_tag_manager_payload.zip/ansible/module_utils/vmware_rest_client.py", line 30, in
"Failed to import the required Python library (vSphere Automation SDK) on xxxhostxxx Python /usr/bin/python3. See https://code.vmware.com/web/sdk/65/vsphere-automation-python for more info. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"
Getting the same error
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_community.vmware.vmware_vm_info_payload_oujsobnq/ansible_community.vmware.vmware_vm_info_payload.zip/ansible_collections/community/vmware/plugins/module_utils/vmware_rest_client.py", line 32, in <module>
from com.vmware.vapi.std_client import DynamicID
ModuleNotFoundError: No module named 'com'
when using the community.vmware.vmware_vm_info with show_tag: true
Environment
sdk package version: nsx-vmc-aws-integration-python-sdk 3.0.2.0.0.16837625 nsx-vmc-policy-python-sdk 3.0.2.0.0.16837625 pyvmomi 7.0.1 vapi-client-bindings 3.5.0 vapi-common-client 2.19.0 vapi-runtime 2.19.0 vmc-client-bindings 1.30.0 vmc-draas-client-bindings 1.15.0 vSphere-Automation-SDK 1.42.0
python version: Python 2.7.5 Python 3.6.8
vSphere version: vSphere 6.5
Operating System/Shell (used to run SDK-based apps): Red Hat Enterprise Linux Server release 7.6 (Maipo)
Steps or code snippet to reproduce
run this yaml file for python3
job log here: { "exception": "Traceback (most recent call last):\n File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1605859409.33-134568295864586/AnsiballZ_vmware_tag_manager.py\", line 102, in\n _ansiballz_main()\n File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1605859409.33-134568295864586/AnsiballZ_vmware_tag_manager.py\", line 17, in _ansiballz_main\n import base64\n File \"/usr/lib64/python3.6/base64.py\", line 9, in \n import re\n File \"/usr/lib64/python3.6/re.py\", line 142, in \n class RegexFlag(enum.IntFlag):\nAttributeError: module 'enum' has no attribute 'IntFlag'\n",
"_ansible_no_log": false,
"_ansible_delegated_vars": {
"ansible_host": "localhost"
},
"module_stderr": "Traceback (most recent call last):\n File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1605859409.33-134568295864586/AnsiballZ_vmware_tag_manager.py\", line 102, in \n _ansiballz_main()\n File \"/var/lib/awx/.ansible/tmp/ansible-tmp-1605859409.33-134568295864586/AnsiballZ_vmware_tag_manager.py\", line 17, in _ansiballz_main\n import base64\n File \"/usr/lib64/python3.6/base64.py\", line 9, in \n import re\n File \"/usr/lib64/python3.6/re.py\", line 142, in \n class RegexFlag(enum.IntFlag):\nAttributeError: module 'enum' has no attribute 'IntFlag'\n",
"changed": false,
"module_stdout": "",
"rc": 1,
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}
run this yaml file for python2
job log here: { "exception": "Traceback (most recent call last):\n File \"/tmp/ansible_vmware_tag_manager_payload_veOEcW/ansible_vmware_tag_manager_payload.zip/ansible/module_utils/vmware_rest_client.py\", line 30, in\n from com.vmware.vapi.std_client import DynamicID\nImportError: No module named com.vmware.vapi.std_client\n",
"_ansible_no_log": false,
"_ansible_delegated_vars": {
"ansible_host": "localhost"
},
"changed": false,
"invocation": {
"module_args": {
"username": "admin",
"object_type": "VirtualMachine",
"protocol": "https",
"hostname": "10.10.10.10",
"object_name": "DEVRHEL",
"state": "add",
"tag_names": [
"RHELServer"
],
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"validate_certs": false
}
},
"msg": "Failed to import the required Python library (vSphere Automation SDK) on MASTER03's Python /usr/bin/python2. See https://code.vmware.com/web/sdk/65/vsphere-automation-python for more info. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"
}
Expected behavior
can't using vmware_tag_manager module on yaml file, when run others vmware module (tried snapshot and guest) is okay.