docker: stop using apt force

Here the desciption from Ansible docs
Corresponds to the --force-yes to apt-get and implies allow_unauthenticated: yes
This option will disable checking both the packages' signatures and the certificates of the web servers they are downloaded from.
This option *is not* the equivalent of passing the -f flag to apt-get on the command line
**This is a destructive operation with the potential to destroy your system, and it should almost never be used.** Please also see man apt-get for more information.

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit f3885aa589)
This commit is contained in:
Etienne Champetier 2021-01-07 17:16:34 -05:00 committed by Kubernetes Prow Robot
parent a923f4e7c0
commit a652a3b3b5
3 changed files with 13 additions and 7 deletions

View file

@ -108,6 +108,17 @@
- ansible_distribution in ["CentOS","RedHat"] and not is_ostree
- yum_result.results | length == 0
- name: Remove dpkg hold
dpkg_selections:
name: "{{ item }}"
selection: install
when: ansible_pkg_mgr == 'apt'
changed_when: false
with_items:
- containerd
- docker-ce
- docker-ce-cli
- name: ensure docker packages are installed
action: "{{ docker_package_info.pkg_mgr }}"
args:
@ -142,7 +153,8 @@
dpkg_selections:
name: "{{ item }}"
selection: hold
when: ansible_os_family in ["Debian"]
when: ansible_pkg_mgr == 'apt'
changed_when: false
with_items:
- docker-ce
- docker-ce-cli

View file

@ -18,11 +18,8 @@ docker_package_info:
pkg_mgr: apt
pkgs:
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
force: yes
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}"
force: yes
- name: "{{ docker_versioned_pkg[docker_version | string] }}"
force: yes
docker_repo_key_info:
pkg_key: apt_key

View file

@ -18,11 +18,8 @@ docker_package_info:
pkg_mgr: apt
pkgs:
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
force: yes
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}"
force: yes
- name: "{{ docker_versioned_pkg[docker_version | string] }}"
force: yes
docker_repo_key_info:
pkg_key: apt_key