Add a task that removes packages from the old distribution method. See https://docs.docker.com/engine/install/ubuntu/

This commit is contained in:
Andrea Dell'Amico 2020-10-15 13:47:03 +02:00
parent 64b0669e21
commit 1a61a27af9
2 changed files with 10 additions and 1 deletions

View File

@ -4,6 +4,9 @@
#apt_key: keyserver={{ docker_repo_keyserver }} id={{ docker_repo_key }} state=present #apt_key: keyserver={{ docker_repo_keyserver }} id={{ docker_repo_key }} state=present
apt_key: url={{ docker_deb_repo_key_url }} state=present apt_key: url={{ docker_deb_repo_key_url }} state=present
- name: Remove the old docker packages, from the old distribution method
apt: pkg={{ docker_deb_old_packages }} state=absent
- name: Remove the obsolete docker repository - name: Remove the obsolete docker repository
apt_repository: repo='{{ docker_deb_repo_old }}' state=absent update_cache=yes apt_repository: repo='{{ docker_deb_repo_old }}' state=absent update_cache=yes

View File

@ -8,7 +8,7 @@ py3_env_pip_pkgs:
docker_deb_repo_key_url: 'https://download.docker.com/linux/ubuntu/gpg' docker_deb_repo_key_url: 'https://download.docker.com/linux/ubuntu/gpg'
# Set to the Debian distribution name if not Ubuntu # Set to the Debian distribution name if not Ubuntu
docker_linux_distribution: '{{ ansible_distribution_release | lower }}' docker_linux_distribution: '{{ ansible_distribution_release | lower }}'
docker_deb_repo_old: 'deb https://apt.dockerproject.org/repo {{ ansible_distribution | lower }}-{{ docker_distribution }} main' docker_deb_repo_old: 'deb https://apt.dockerproject.org/repo {{ ansible_distribution | lower }}-17 main'
docker_deb_repo: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable' docker_deb_repo: 'deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable'
docker_el_repo: 'https://download.docker.com/linux/centos/docker-ce.repo' docker_el_repo: 'https://download.docker.com/linux/centos/docker-ce.repo'
@ -19,6 +19,12 @@ docker_deb_packages:
- docker-ce-cli - docker-ce-cli
- containerd.io - containerd.io
docker_deb_old_packages:
- docker-engine
- docker.io
- containerd
- runc
docker_el_packages: docker_el_packages:
- docker-ce - docker-ce
- docker-ce-cli - docker-ce-cli