How to Find OVF path to clone a OVF template from content library & which module need to use via Ansible Playbook

Hello everyone,

I am seeking assistance with cloning an OVF template from a content library using Ansible. Specifically, I would like to know which Ansible components are available for this task and how to retrieve the OVF and OVA path or URL.

I am currently using the following module in my Ansible playbook to clone a VM:

community.vmware.vmware_deploy_ovf:
hostname: “XYZ”
username: “XYZ”
password: “XYZ”
validate_certs: no
datacenter: “XYZ”
cluster: “XYZ”
datastore: “XYZ”
folder: “XYZ”
name: “XYZ”
ovf: “{{ ovf_path }}”
networks:
“XYZ”:
ip: “XYZ”
netmask: “XYZ”
gateway: “XYZ”
power_on: yes
delegate_to: localhost

One of the mandatory inputs is “ovf_path,” but I am unsure how to retrieve the path details in VMware. Is there any script available or a method to find the absolute OVF path or URL in VMware vSphere Client to execute the playbook successfully?

Any guidance or examples would be greatly appreciated. Thank you!!

That module is for deploying an OVF from your local machine (or whatever machine is running the ansible module).

To deploy an OVF from a content library, you should use
vmware_content_deploy_ovf_template_module

This module was recently migrated to the new vmware.vmware collection:

It will be included in the next release in a few weeks