Unable to gather datastore facts with vmware_datastore_info module

I’m trying to collect the VMware datastore info from the ansible module “community.vmware.vmware_datastore_info” with the below task and debug the same:

  • name: Gather info from datacenter about specific datastore
    community.vmware.vmware_datastore_info:
    hostname: ‘{{ vcenter_hostname }}’
    username: ‘{{ username }}’
    password: ‘{{ password }}’
    datacenter_name: ‘{{ datacenter_name }}’
    name: ENV04
    validate_certs: False
    delegate_to: localhost
    register: info

  • debug:
    msg: “{{ info }}”
    The debug task is returning the below output:

TASK [Gather info from datacenter about specific datastore] ************************************************************************************************************
ok: [172.17.92.2 → localhost]

TASK [debug] ***********************************************************************************************************************************************************
ok: [172.17.92.2] => {
“msg”: {
“changed”: false,
“datastores”: ,
“failed”: false
}
}
Rather than the one mentioned in the ansible-doc for this module:

RETURN VALUES:

  • datastores
    metadata about the available datastores

returned: always
sample:

  • accessible: true
    capacity: 5497558138880
    datastore_cluster: datacluster0
    freeSpace: 4279000641536
    maintenanceMode: normal
    multipleHostAccess: true
    name: datastore3
    nfs_path: /vol/datastore3
    nfs_server: nfs_server1
    provisioned: 1708109410304
    type: NFS
    uncommitted: 489551912960
    url: ds:///vmfs/volumes/420b3e73-67070776/
    Can anyone suggest what was the issue, as I was getting the expected output before and now it is not coming.