- name: Get a list of all the datacenters
  register: existing_datacenters
  vmware.vmware_rest.vcenter_datacenter_info:
- ansible.builtin.debug: var=existing_datacenters
- name: Force delete the existing DC
  vmware.vmware_rest.vcenter_datacenter:
    state: absent
    datacenter: '{{ item.datacenter }}'
    force: true
  with_items: "{{ existing_datacenters.value }}"
  register: _result
  until:
  - _result is not failed
  retries: 7
