Hi Nikita, This seems to be an issue in the module. Could you please raise an issue against - https://github.com/ansible-collections/vmware repo? also add your vCenter version and Pyvmomi, vSphere Automation SDK version.
Thanks, On Tue, Apr 28, 2020 at 10:37 PM nikita nipon < antoniojimenezramire...@gmail.com> wrote: > I have this playbook: > > --- > - hosts: localhost > gather_facts: no > vars: > vcenter_server: > vcenter_user: > vcenter_pass: > datacenter_name: > cluster_name: > ansible_python_interpreter: " > tasks: > - name: Clone the template > vmware_content_deploy_template: > hostname: '{{ vcenter_server }}' > host: pesxintra14.da.inf.sta > username: '{{ vcenter_user }}' > password: '{{ vcenter_pass }}' > validate_certs: False > name: testaes36 > template: vmw-rhel-7 > validate_certs: False > datacenter: '{{ datacenter_name }}' > folder: /{{ datacenter_name }}/vm > cluster: '{{ cluster_name }}' > datastore: VMAX2_LM_INTRA_DS_CLUSTER_01 > state: poweredon > delegate_to: localhost > > when i executed this playbook i have this error: > > The full traceback is: > Traceback (most recent call last): > File > "/root/.ansible/tmp/ansible-tmp-1588091260.39-16412-32997630688977/AnsiballZ_vmware_content_deploy_template.py", > line 102, in <module> > _ansiballz_main() > File > "/root/.ansible/tmp/ansible-tmp-1588091260.39-16412-32997630688977/AnsiballZ_vmware_content_deploy_template.py", > line 94, in _ansiballz_main > invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) > File > "/root/.ansible/tmp/ansible-tmp-1588091260.39-16412-32997630688977/AnsiballZ_vmware_content_deploy_template.py", > line 40, in invoke_module > > runpy.run_module(mod_name='ansible.modules.cloud.vmware.vmware_content_deploy_template', > init_globals=None, run_name='__main__', alter_sys=True) > File "/usr/lib64/python3.6/runpy.py", line 205, in run_module > return _run_module_code(code, init_globals, run_name, mod_spec) > File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code > mod_name, mod_spec, pkg_name, script_name) > File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code > exec(code, run_globals) > File > "/tmp/ansible_vmware_content_deploy_template_payload_j4th38xk/ansible_vmware_content_deploy_template_payload.zip/ansible/modules/cloud/vmware/vmware_content_deploy_template.py", > line 271, in <module> > File > "/tmp/ansible_vmware_content_deploy_template_payload_j4th38xk/ansible_vmware_content_deploy_template_payload.zip/ansible/modules/cloud/vmware/vmware_content_deploy_template.py", > line 267, in main > File > "/tmp/ansible_vmware_content_deploy_template_payload_j4th38xk/ansible_vmware_content_deploy_template_payload.zip/ansible/modules/cloud/vmware/vmware_content_deploy_template.py", > line 163, in deploy_vm_from_template > File > "/tmp/ansible_vmware_content_deploy_template_payload_j4th38xk/ansible_vmware_content_deploy_template_payload.zip/ansible/module_utils/vmware_rest_client.py", > line 274, in get_datacenter_by_name > File "/usr/lib/python3.6/site-packages/com/vmware/vcenter_client.py", > line 636, in list > 'filter': filter, > File "/usr/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py", > line 345, in _invoke > return self._api_interface.native_invoke(ctx, _method_name, kwargs) > File "/usr/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py", > line 298, in native_invoke > self._rest_converter_mode) > com.vmware.vapi.std.errors_client.OperationNotFound: {messages : > [LocalizableMessage(id='vapi.method.input.invalid.interface', > default_message="Cannot find service 'com.vmware.vcenter.datacenter'.", > args=['com.vmware.vcenter.datacenter'], params=None, localized=None)], data > : None, error_type : None} > fatal: [localhost -> localhost]: FAILED! => { > "changed": false, > "module_stderr": "Traceback (most recent call last):\n File > \"/root/.ansible/tmp/ansible-tmp-1588091260.39-16412-32997630688977/AnsiballZ_vmware_content_deploy_template.py\", > line 102, in <module>\n _ansiballz_main()\n File > \"/root/.ansible/tmp/ansible-tmp-1588091260.39-16412-32997630688977/AnsiballZ_vmware_content_deploy_template.py\", > line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, > ANSIBALLZ_PARAMS)\n File > \"/root/.ansible/tmp/ansible-tmp-1588091260.39-16412-32997630688977/AnsiballZ_vmware_content_deploy_template.py\", > line 40, in invoke_module\n > runpy.run_module(mod_name='ansible.modules.cloud.vmware.vmware_content_deploy_template', > init_globals=None, run_name='__main__', alter_sys=True)\n File > \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n return > _run_module_code(code, init_globals, run_name, mod_spec)\n File > \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n > mod_name, mod_spec, pkg_name, script_name)\n File > \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n exec(code, > run_globals)\n File > \"/tmp/ansible_vmware_content_deploy_template_payload_j4th38xk/ansible_vmware_content_deploy_template_payload.zip/ansible/modules/cloud/vmware/vmware_content_deploy_template.py\", > line 271, in <module>\n File > \"/tmp/ansible_vmware_content_deploy_template_payload_j4th38xk/ansible_vmware_content_deploy_template_payload.zip/ansible/modules/cloud/vmware/vmware_content_deploy_template.py\", > line 267, in main\n File > \"/tmp/ansible_vmware_content_deploy_template_payload_j4th38xk/ansible_vmware_content_deploy_template_payload.zip/ansible/modules/cloud/vmware/vmware_content_deploy_template.py\", > line 163, in deploy_vm_from_template\n File > \"/tmp/ansible_vmware_content_deploy_template_payload_j4th38xk/ansible_vmware_content_deploy_template_payload.zip/ansible/module_utils/vmware_rest_client.py\", > line 274, in get_datacenter_by_name\n File > \"/usr/lib/python3.6/site-packages/com/vmware/vcenter_client.py\", line > 636, in list\n 'filter': filter,\n File > \"/usr/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py\", line > 345, in _invoke\n return self._api_interface.native_invoke(ctx, > _method_name, kwargs)\n File > \"/usr/lib/python3.6/site-packages/vmware/vapi/bindings/stub.py\", line > 298, in native_invoke\n > self._rest_converter_mode)\ncom.vmware.vapi.std.errors_client.OperationNotFound: > {messages : [LocalizableMessage(id='vapi.method.input.invalid.interface', > default_message=\"Cannot find service 'com.vmware.vcenter.datacenter'.\", > args=['com.vmware.vcenter.datacenter'], params=None, localized=None)], data > : None, error_type : None}\n", > "module_stdout": "", > "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", > "rc": 1 > > Please help- > > -- > 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-project+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/21ec9ce4-25e6-43aa-b34c-fcdfe4fbf160%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/21ec9ce4-25e6-43aa-b34c-fcdfe4fbf160%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Thanks, Abhijeet Kasurde -- 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-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFwWkHp%3DXZz9pHquuWNG23avV2SnOcrfDQeQYetBHyh67qcfQg%40mail.gmail.com.