2018-03-29 04:10:39 +08:00
|
|
|
---
|
2020-01-28 18:31:40 +08:00
|
|
|
- name: Remove legacy docker repo file
|
|
|
|
file:
|
|
|
|
path: "{{ yum_repo_dir }}/docker.repo"
|
|
|
|
state: absent
|
|
|
|
when:
|
|
|
|
- ansible_distribution in ["CentOS","RedHat","OracleLinux"]
|
|
|
|
- not is_atomic
|
|
|
|
|
2018-03-29 04:10:39 +08:00
|
|
|
- name: Ensure old versions of Docker are not installed. | Debian
|
2019-04-02 06:08:35 +08:00
|
|
|
apt:
|
|
|
|
name: '{{ docker_remove_packages_apt }}'
|
2018-03-29 04:10:39 +08:00
|
|
|
state: absent
|
2018-04-06 18:16:05 +08:00
|
|
|
when:
|
|
|
|
- ansible_os_family == 'Debian'
|
2019-02-01 06:57:22 +08:00
|
|
|
- (docker_versioned_pkg[docker_version | string] is search('docker-ce'))
|
2018-03-29 04:10:39 +08:00
|
|
|
|
|
|
|
- name: Ensure old versions of Docker are not installed. | RedHat
|
2019-04-02 06:08:35 +08:00
|
|
|
yum:
|
|
|
|
name: '{{ docker_remove_packages_yum }}'
|
2018-03-29 04:10:39 +08:00
|
|
|
state: absent
|
2018-04-06 18:16:05 +08:00
|
|
|
when:
|
|
|
|
- ansible_os_family == 'RedHat'
|
2019-02-01 06:57:22 +08:00
|
|
|
- (docker_versioned_pkg[docker_version | string] is search('docker-ce'))
|
2018-04-06 18:16:05 +08:00
|
|
|
- not is_atomic
|