[tests] Make setup_docker clean up better (#71949)
Change: - pip packages should get removed after, not try to add them again - Try removing containerd.io package too Test Plan: - CI Signed-off-by: Rick Elrod <rick@elrod.me>
This commit is contained in:
parent
35b0fef536
commit
6a7e637c5f
4 changed files with 12 additions and 3 deletions
|
@ -15,4 +15,5 @@
|
||||||
- docker
|
- docker
|
||||||
- docker-ce
|
- docker-ce
|
||||||
- docker-ce-cli
|
- docker-ce-cli
|
||||||
|
- containerd.io
|
||||||
state: absent
|
state: absent
|
||||||
|
|
|
@ -7,6 +7,7 @@ docker_packages:
|
||||||
- docker-ce
|
- docker-ce
|
||||||
|
|
||||||
docker_pip_extra_packages: []
|
docker_pip_extra_packages: []
|
||||||
|
docker_pip_never_remove: []
|
||||||
docker_pip_packages:
|
docker_pip_packages:
|
||||||
- docker
|
- docker
|
||||||
|
|
||||||
|
@ -14,3 +15,4 @@ docker_cleanup_packages:
|
||||||
- docker
|
- docker
|
||||||
- docker-ce
|
- docker-ce
|
||||||
- docker-ce-cli
|
- docker-ce-cli
|
||||||
|
- containerd.io
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
- name: remove pip packages
|
- name: remove pip packages
|
||||||
pip:
|
pip:
|
||||||
state: present
|
state: absent
|
||||||
name: "{{ docker_pip_packages | union(docker_pip_extra_packages) }}"
|
name: "{{ docker_pip_packages | union(docker_pip_extra_packages) | difference(docker_pip_never_remove) }}"
|
||||||
listen: cleanup docker
|
listen: cleanup docker
|
||||||
when: not docker_skip_cleanup | bool
|
when: not docker_skip_cleanup | bool
|
||||||
|
|
||||||
- name: remove docker pagkages
|
- name: remove docker packages
|
||||||
action: "{{ ansible_facts.pkg_mgr }}"
|
action: "{{ ansible_facts.pkg_mgr }}"
|
||||||
args:
|
args:
|
||||||
name: "{{ docker_cleanup_packages }}"
|
name: "{{ docker_cleanup_packages }}"
|
||||||
|
|
|
@ -10,3 +10,9 @@ docker_packages:
|
||||||
|
|
||||||
docker_pip_extra_packages:
|
docker_pip_extra_packages:
|
||||||
- requests==2.6.0
|
- requests==2.6.0
|
||||||
|
|
||||||
|
# We need to pin the above so pip finds the right system-installed package
|
||||||
|
# but we never want to try to remove it, so we substract this from the set of
|
||||||
|
# packages we remove on cleanup
|
||||||
|
docker_pip_never_remove:
|
||||||
|
- requests==2.6.0
|
||||||
|
|
Loading…
Reference in a new issue