---

- block:

  - name: Download docker-compose
    get_url:
      url: "{{ docker_compose_url }}"
      dest: "/usr/local/bin/docker-compose"
      checksum: "sha256:{{ docker_compose_sha }}"
      use_proxy: no
      mode: 0755
    register: docker_compose_downloaded
    retries: 2
    delay: 10
    until: docker_compose_downloaded is succeeded

  - name: Download docker-compose completion
    get_url:
      url: "{{ docker_compose_completion_url }}"
      dest: "/etc/bash_completion.d/docker-compose"
      checksum: "sha256:{{ docker_compose_completion_sha }}"
      use_proxy: no
      mode: 0644
    register: docker_compose_completion_downloaded
    retries: 2
    delay: 10
    until: docker_compose_completion_downloaded is succeeded

  become: yes
