- name: determine distribution
  setup:
    gather_subset:
      - distribution


- name: install docker cli
  package:
    name: docker-cli
  when: ansible_distribution == 'Alpine'


- block:
    - name: add docker repository
      include_tasks: add_docker_repo.yml


    - name: install docker cli
      apt:
        name:
          - docker-ce-cli
        force_apt_get: yes
        state: latest

  when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
