---
- name: Ensure docker registry container is stopped
  kayobe_container:
    name: "{{ item.value.container_name }}"
    state: "absent"
  with_dict: "{{ docker_registry_services }}"

- name: Check whether docker registry volumes are absent
  kayobe_container_volume:
    name: "{{ volume }}"
    state: absent
  with_subelements:
    - "{{ docker_registry_services }}"
    - volumes
  when: "'/' not in volume"
  vars:
    volume: "{{ item.1.split(':')[0] }}"
