# Unable to solve issue with vmware.vmware.deploy\_content\_library\_template module

**URL:** <https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352>\
**Category:** Get Help\
**Tags:** azure, vmware\
**Created:** [June 12, 2025, 8:55pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352 "2025-06-12T20:55:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 12, 2025, 8:55pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/1 "2025-06-12T20:55:30Z")

</div>

I am running into an issue with the vmware.vmware.deploy\_content\_library\_template module in my playbook.

Brief summary of how its being used:  
I have an Azure Devops pipeline that runs the playbook via an ansible container in our Azure. The container is running:  
Anisble core v2.18.6  
Python v3.12.11  
Aiohttp v3.12.9  
community.vmware v5.6.0  
vmware.vmware v1.11.0  
VMware vSphere Automation SDK for Python v1.87.0

The specific module is displayed below:

```auto
    - name: Deploy VM from OVF Template
      vmware.vmware.deploy_content_library_template:
        hostname: '{{ vcenter_hostname }}'
        username: '{{ vcenter_username }}'
        password: '{{ vcenter_password }}'
        validate_certs: false
        library_item_name: "{{ ovf_template }}"
        library_name: "{{ content_library }}"
        vm_name: "{{ vm_name }}"
        datacenter: "{{ datacenter }}"
        datastore: "{{ vm_datastore }}"
        esxi_host: "{{ esx_hostname }}"
        cluster: "{{ cluster }}"
        vm_folder: "{{ vmfolder }}"
      register: deploy_result
      when: not reconfigure and vm_exist is undefined

```

The error I am experiencing is here with sensitive variables marked out:

```auto
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "cluster": null,
            "datacenter": "Plzen",
            "datastore": " ************",
            "datastore_cluster": null,
            "esxi_host": " ***********",
            "hostname": " ***************",
            "library_id": null,
            "library_item_id": null,
            "library_item_name": " *********************",
            "library_name": " ****************",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "port": 443,
            "power_on_after_deploy": false,
            "proxy_host": null,
            "proxy_port": null,
            "proxy_protocol": "https",
            "resource_pool": null,
            "username": " *************************",
            "validate_certs": false,
            "vm_folder": "/Plzen/vm",
            "vm_name": " ***********"
        }
    },
    "msg": "Unable to find folder with absolute path Plzen/vm"
}

```

I have confirmed the file path using the community.vmware.vmware\_folder\_info module and the community.vmware.vmware\_vm\_info module on other running VMS on the host.

This is a recent issue as prior to this, we were using an older version of ansible and utilizing the now deprecated community.vmware.vmware\_content\_deploy\_template module. With everything updated to make use of newly added modules, I am running into this issue and cant get past this task in my playbook.

I have tried various different ways of file path naming as well as exluding defining the variable entirely but all have come back with this same error. All tasks prior to this one execute with no issue.

Any help would be greatly appreciated as I am at a loss with what the issue could be.

---

<div class="post-metadata">

**Author:** ![mariolenz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mariolenz/32/108_2.png) [@mariolenz](https://forum.ansible.com/u/mariolenz)\
**Post date:** [June 13, 2025, 2:55pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/2 "2025-06-13T14:55:54Z")

</div>

Just to clarify: Your datacenter is named `Plzen` and you want to deploy the OVF directly there. Not into any specific folder?

In that case, maybe just omit the `vm_folder` parameter. According to the [documentation](https://galaxy.ansible.com/ui/repo/published/vmware/vmware/content/module/deploy_content_library_template/?version=1.11.0) it’s not required.

cc @mikemorency

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 13, 2025, 3:29pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/3 "2025-06-13T15:29:52Z")

</div>

That is correct and it is also something I’ve already tried. No matter if I omit the parameter, set it statically, set it as a variable and define the variable in my group cars. They all result in the same case of unable to find the folder which is odd because other modules find the folder without issue.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [June 13, 2025, 3:51pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/4 "2025-06-13T15:51:05Z")

</div>

Have you tried other vmware.vmware modules and they find the folder OK, or just other modules from other collections?  
The inventory path is also case sensitive, I think.

Can you try using the lookup plugins as a sanity check? Something like this playbook, feel free to redact whatever in the output:

```auto
---
- hosts: localhost
  gather_facts: false
  vars:
    conn:
      vcenter_hostname:
      vcenter_username:
      vcenter_password:
      vcenter_validate_certs: false
  tasks:
    - debug:
        var: lookup('vmware.vmware.moid_from_path', item, **conn)
      loop:
        - '/'
        - '/Plzen'
        - '/Plzen/'
        - '/Plzen/vm'

```

---

<div class="post-metadata">

**Author:** ![mariolenz](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mariolenz/32/108_2.png) [@mariolenz](https://forum.ansible.com/u/mariolenz)\
**Post date:** [June 13, 2025, 4:10pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/5 "2025-06-13T16:10:31Z")

</div>

For the record: [Unable to solve issue with vmware.vmware.deploy\_content\_library\_template module](https://github.com/ansible-collections/vmware.vmware/issues/202)

ATM it looks like this _might_ be a bug somewhere in the code, so I suggest to continue the discussion in the issue you’ve opened on GitHub 👆

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 13, 2025, 7:31pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/6 "2025-06-13T19:31:17Z")

</div>

Sorry, trying to get this for you but having to modify it for my pipeline as secrets are retrieved from KV and then passed by the pipeline to the ansible server. Bear with me.

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 13, 2025, 7:50pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/7 "2025-06-13T19:50:47Z")

</div>

Alright so as stated, I had to modify it a little bit to work in the pipeline but essentially I made it into its own task file.

Task file is here:

```auto
---
- block:
    - name: Include variables
      ansible.builtin.include_vars:
        file: "group_vars/{{ vsensor_hostname }}.yml"

    - name: Debug vmware.vmware
      debug:
        var: lookup('vmware.vmware.moid_from_path', item, hostname="{{ vcenter_hostname }}", username="{{ vcenter_username }}", password="{{ vcenter_password }}" )
      loop:
        - '/'
        - '/Plzen'
        - '/Plzen/'
        - '/Plzen/vm'

```

and just for confirmation, I checked the server and ran

```auto
ansible-galaxy collection list

```

This returned the following

```auto
# /usr/local/lib/python3.12/site-packages/ansible_collections
Collection Version
---------------------------------------- -------
amazon.aws 9.5.0
ansible.netcommon 7.2.0
ansible.posix 1.6.2
ansible.utils 5.1.2
ansible.windows 2.8.0
arista.eos 10.1.1
awx.awx 24.6.1
azure.azcollection 3.3.1
check_point.mgmt 6.4.0
chocolatey.chocolatey 1.5.3
cisco.aci 2.11.0
cisco.asa 6.1.0
cisco.dnac 6.31.3
cisco.intersight 2.1.0
cisco.ios 9.2.0
cisco.iosxr 10.3.1
cisco.ise 2.10.0
cisco.meraki 2.21.1
cisco.mso 2.10.0
cisco.nxos 9.4.0
cisco.ucs 1.16.0
cloud.common 4.1.0
cloudscale_ch.cloud 2.4.1
community.aws 9.3.0
community.ciscosmb 1.0.10
community.crypto 2.26.1
community.digitalocean 1.27.0
community.dns 3.2.4
community.docker 4.6.0
community.general 10.7.0
community.grafana 2.2.0
community.hashi_vault 6.2.0
community.hrobot 2.3.0
community.library_inventory_filtering_v1 1.1.1
community.libvirt 1.3.1
community.mongodb 1.7.9
community.mysql 3.13.0
community.network 5.1.0
community.okd 4.0.1
community.postgresql 3.14.1
community.proxysql 1.6.0
community.rabbitmq 1.4.0
community.routeros 3.6.0
community.sap_libs 1.4.2
community.sops 2.0.5
community.vmware 5.6.0
community.windows 2.4.0
community.zabbix 3.3.0
containers.podman 1.16.3
cyberark.conjur 1.3.3
cyberark.pas 1.0.35
dellemc.enterprise_sonic 2.5.1
dellemc.openmanage 9.12.0
dellemc.powerflex 2.6.0
dellemc.unity 2.0.0
f5networks.f5_modules 1.35.0
fortinet.fortimanager 2.9.1
fortinet.fortios 2.4.0
google.cloud 1.5.3
grafana.grafana 5.7.0
hetzner.hcloud 4.3.0
hitachivantara.vspone_block 3.4.1
ibm.qradar 4.0.0
ibm.spectrum_virtualize 2.0.0
ibm.storage_virtualize 2.7.3
ieisystem.inmanage 3.0.0
infinidat.infinibox 1.4.5
infoblox.nios_modules 1.8.0
inspur.ispim 2.2.3
junipernetworks.junos 9.1.0
kaytus.ksmanage 2.0.0
kubernetes.core 5.3.0
kubevirt.core 2.2.2
lowlydba.sqlserver 2.6.1
microsoft.ad 1.9.0
microsoft.iis 1.0.2
netapp.cloudmanager 21.24.0
netapp.ontap 22.14.0
netapp.storagegrid 21.14.0
netapp_eseries.santricity 1.4.1
netbox.netbox 3.21.0
ngine_io.cloudstack 2.5.0
openstack.cloud 2.4.1
ovirt.ovirt 3.2.0
purestorage.flasharray 1.34.1
purestorage.flashblade 1.20.0
sensu.sensu_go 1.14.0
splunk.es 4.0.0
telekom_mms.icinga_director 2.2.2
theforeman.foreman 4.2.0
vmware.vmware 1.11.0
vmware.vmware_rest 4.7.0
vultr.cloud 1.13.0
vyos.vyos 5.0.0
wti.remote 1.0.10

```

but the pipeline returned with this error:

```auto
TASK [dark_trace_sensor : Debug vmware.vmware] *********************************
task path: /home/ansible/ansible_playbooks/ansible/roles/dark_trace_sensor/tasks/debug.yml:34
Loading collection vmware.vmware from /usr/local/lib/python3.12/site-packages/ansible_collections/vmware/vmware
fatal: [localhost]: FAILED! => {
    "msg": "lookup plugin (vmware.vmware.moid_from_path) not found"
}

PLAY RECAP *********************************************************************

```

So now I’m at a loss at how that plugin isnt found when vmware.vmware is installed.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [June 13, 2025, 7:55pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/8 "2025-06-13T19:55:49Z")

</div>

The lookup plugin is in version 2.1.0, so you will need to install that version

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 13, 2025, 7:58pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/9 "2025-06-13T19:58:07Z")

</div>

sorry, been a long week lol. Totally overlooked that.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [June 13, 2025, 7:58pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/10 "2025-06-13T19:58:40Z")

</div>

No worries, I did too 🙂

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 13, 2025, 9:34pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/11 "2025-06-13T21:34:41Z")

</div>

Alright so keep in mind that in the target vSphere, there are many different datacenters so this command happening to return multiple entries for ‘/’ is expected. What is interesting though is that it doesn’t seem to locate any folders starting with Plzen as the datacenter.

```auto
TASK **********: Get VM MOIDs from paths]*****************************
task path: /home/ansible/ansible_playbooks/ansible/roles/ ********* /tasks/debug.yml:7
Loading collection vmware.vmware from /home/ansible/.ansible/collections/ansible_collections/vmware/vmware
ok: [localhost] => (item=/) => {
    "msg": "group-d64,group-d65,group-d72,group-d71,group-d73"
}
ok: [localhost] => (item=/Plzen) => {
    "msg": []
}
ok: [localhost] => (item=/Plzen/) => {
    "msg": []
}
ok: [localhost] => (item=/Plzen/vm) => {
    "msg": []
}

```

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 13, 2025, 9:55pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/12 "2025-06-13T21:55:52Z")

</div>

This has me wondering why community.vmware is able to see folders but vmware.vmware doesnt seem to be seeing them.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [June 13, 2025, 10:00pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/13 "2025-06-13T22:00:22Z")

</div>

I believe objects with moid ‘group-’ are folders too, whereas datacenters are ‘datacenter-’

I’ll have to double check that though

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 13, 2025, 10:01pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/14 "2025-06-13T22:01:46Z")

</div>

yeah I think you are correct, which has me wondering if something is messed up with the file paths on that specific datacenter. I can try and check with PowerCLI but may have to get with my infrastructure team to look further into it.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [June 14, 2025, 3:32am UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/15 "2025-06-14T03:32:01Z")

</div>

So I was doing some reading, and you can put datacenters into folders. It looks like that is what your team did, based on the MOIDs. If so, your real path would be something like ///vm…

Im interested to hear if that’s the case so please update us with what you find! I think the module will work if you specify the folder path, but I am not sure 🙂

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 14, 2025, 4:41am UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/16 "2025-06-14T04:41:23Z")

</div>

If it turns out to be the case, I will simultaneously be not surprised and wildly infuriated at the same time. I will definitely report back.

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 16, 2025, 2:56pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/17 "2025-06-16T14:56:19Z")

</div>

I’m still trying to work this out. I ran some PowerCLI to see what I could that way. The way its set up in vSphere is

```auto
*Root*
->Europe(Folder of type datacenter)
    ->Czechia(Folder of type datacenter)
        ->Plzen(Datacenter)

```

The only one that shows as a datacenter with the PowerCLI command “Get-datacenter” is Plzen. and the folders for the Plzen datacenter are:

```auto
vm - type VM
network - type Network
host - type HostAndCluster
datastore - type Datastore
Discovered virtual machine - type VM

```

Just a little more info so far but I don’t think the absolute path has any weird nesting going on. It would seem that maybe the module being used can’t see into folders or isn’t parsing them while looking for the datacenter.

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [June 16, 2025, 3:11pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/18 "2025-06-16T15:11:28Z")

</div>

The absolute path to your desired folder would be `/Europe/Czechia/Plzen/vm`

Can you/have you tried that?

```auto
    - name: Deploy VM from OVF Template
      vmware.vmware.deploy_content_library_template:
        hostname: '{{ vcenter_hostname }}'
        username: '{{ vcenter_username }}'
        password: '{{ vcenter_password }}'
        validate_certs: false
        library_item_name: "{{ ovf_template }}"
        library_name: "{{ content_library }}"
        vm_name: "{{ vm_name }}"
        datacenter: "{{ datacenter }}"
        datastore: "{{ vm_datastore }}"
        esxi_host: "{{ esx_hostname }}"
        cluster: "{{ cluster }}"
        vm_folder: /Europe/Czechia/Plzen/vm
      register: deploy_result
      when: not reconfigure and vm_exist is undefined

```

If you do not specify the (absolute) folder path, many of the modules assume the datacenter is at the top level of the file structure. Since your environment does not match this, you will need to specify your absolute folder path whenever possible (assuming this works)

---

<div class="post-metadata">

**Author:** ![Jwillett17](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@Jwillett17](https://forum.ansible.com/u/Jwillett17)\
**Post date:** [June 16, 2025, 3:48pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/19 "2025-06-16T15:48:12Z")

</div>

No matter how I try to label the folder, it keeps trying to append the path to the end of Plzen/vm  
I have tried:

```auto
vm_folder: /Europe/Czechia/Plzen/vm
vm_folder: ''/Europe/Czechia/Plzen/vm''
vm_folder: ''Europe/Czechia/Plzen/vm''
vm_folder: Europe/Czechia/Plzen/vm

```

No matter what, it just keeps trying to do this

```auto
 "msg": "Unable to find folder with absolute path Plzen/vm/Europe/Czechia/Plzen/vm"

```

---

<div class="post-metadata">

**Author:** ![mikemorency](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mikemorency/32/2672_2.png) [@mikemorency](https://forum.ansible.com/u/mikemorency)\
**Post date:** [June 16, 2025, 3:51pm UTC](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352/20 "2025-06-16T15:51:44Z")

</div>

Hm, OK it seems like a bug then! I will try to get a fix in with the next release. Ill keep updates in the github issue

[Next page](https://forum.ansible.com/t/unable-to-solve-issue-with-vmware-vmware-deploy-content-library-template-module/43352.md?page=2)
