diff --git a/tasks/docker.debian.yml b/tasks/docker.debian.yml index 2da5988..99cfa0f 100644 --- a/tasks/docker.debian.yml +++ b/tasks/docker.debian.yml @@ -12,12 +12,18 @@ - name: Add APT key for docker repository become: yes - shell: "curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -" + shell: "curl -fsSL https://download.docker.com/linux/{{ ansible_distribution|lower }}/gpg | apt-key add -" - name: Add repository become: yes - shell: 'add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"' + shell: 'echo "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution|lower }} $(lsb_release -cs) stable" > /etc/apt/sources.list.d/riotkit-docker.list' - name: Install docker from the download.docker.com repository become: yes - apt: name="docker-ce" state=present update_cache=yes + apt: + name: + - docker-ce + - docker-ce-cli + - containerd.io + state: present + update_cache: yes diff --git a/tasks/docker.yml b/tasks/docker.yml index 298d95a..d945864 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -21,10 +21,10 @@ - name: Install docker from main repository become: yes apt: name="docker.io" state=present update_cache=yes - when: ansible_distribution != 'Debian' and (docker_is_not_running.stdout|bool or enforce_docker_update|bool) + when: ansible_distribution != 'Debian' and ansible_distribution != 'Ubuntu' and (docker_is_not_running.stdout|bool or enforce_docker_update|bool) - include: docker.debian.yml - when: ansible_distribution == 'Debian' and (docker_is_not_running.stdout|bool or enforce_docker_update|bool) + when: (ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu') and (docker_is_not_running.stdout|bool or enforce_docker_update|bool) - name: Delete old docker-compose from package manager become: yes