---
- name: Check if docker-compose is installed
  ignore_errors: true
  command: docker-compose --version
  register: dockercompose_install_version

- name: Sync docker-compose to remote
  when: or (.dockercompose_install_version.stderr | ne "") (.dockercompose_install_version.stdout | ne (printf "Docker Compose version %s" .dockercompose_version))
  copy:
    src: |
      {{ .work_dir }}/kubekey/image-registry/docker-compose/{{ .dockercompose_version }}/{{ .binary_type.stdout }}/docker-compose
    dest: /usr/local/bin/docker-compose
    mode: 0755
