---
- include_tasks: docker.yaml

- name: DockerCompose | Verify if Docker Compose is installed on the system
  ignore_errors: true
  command: docker-compose --version
  register: dockercompose_install_version

- name: DockerCompose | Install or update Docker Compose if not present or version mismatch
  when: or (.dockercompose_install_version.error | empty | not) (.dockercompose_install_version.stdout | ne (printf "Docker Compose version %s" .image_registry.dockercompose_version))
  copy:
    src: >-
      {{ .binary_dir }}/image-registry/docker-compose/{{ .cri.dockercompose_version }}/{{ .binary_type }}/docker-compose
    dest: /usr/local/bin/docker-compose
    mode: 0755