---

- block:
    - name: remove iso file from data_domain
      ovirt_disk:
        auth: "{{ ovirt_auth }}"
        name: "{{ iso_file }}"
        storage_domain: "{{ providers.ovirt.data_domain | default('data_domain') }}"
        state: absent
  rescue:
    - include_tasks: wait_iso_disk_unlock_pre29.yml
      when: ansible_version.full is version('2.9', '<')

    - include_tasks: wait_iso_disk_unlock.yml
      when: ansible_version.full is version('2.9', '>=')

    - name: remove iso file from data_domain
      ovirt_disk:
        auth: "{{ ovirt_auth }}"
        name: "{{ iso_file }}"
        storage_domain: "{{ providers.ovirt.data_domain | default('data_domain') }}"
        state: absent