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:
parent
a923f4e7c0
commit
a652a3b3b5
3 changed files with 13 additions and 7 deletions
|
@ -108,6 +108,17 @@
|
||||||
- ansible_distribution in ["CentOS","RedHat"] and not is_ostree
|
- ansible_distribution in ["CentOS","RedHat"] and not is_ostree
|
||||||
- yum_result.results | length == 0
|
- 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
|
- name: ensure docker packages are installed
|
||||||
action: "{{ docker_package_info.pkg_mgr }}"
|
action: "{{ docker_package_info.pkg_mgr }}"
|
||||||
args:
|
args:
|
||||||
|
@ -142,7 +153,8 @@
|
||||||
dpkg_selections:
|
dpkg_selections:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
selection: hold
|
selection: hold
|
||||||
when: ansible_os_family in ["Debian"]
|
when: ansible_pkg_mgr == 'apt'
|
||||||
|
changed_when: false
|
||||||
with_items:
|
with_items:
|
||||||
- docker-ce
|
- docker-ce
|
||||||
- docker-ce-cli
|
- docker-ce-cli
|
||||||
|
|
|
@ -18,11 +18,8 @@ docker_package_info:
|
||||||
pkg_mgr: apt
|
pkg_mgr: apt
|
||||||
pkgs:
|
pkgs:
|
||||||
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
|
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
|
||||||
force: yes
|
|
||||||
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}"
|
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}"
|
||||||
force: yes
|
|
||||||
- name: "{{ docker_versioned_pkg[docker_version | string] }}"
|
- name: "{{ docker_versioned_pkg[docker_version | string] }}"
|
||||||
force: yes
|
|
||||||
|
|
||||||
docker_repo_key_info:
|
docker_repo_key_info:
|
||||||
pkg_key: apt_key
|
pkg_key: apt_key
|
||||||
|
|
|
@ -18,11 +18,8 @@ docker_package_info:
|
||||||
pkg_mgr: apt
|
pkg_mgr: apt
|
||||||
pkgs:
|
pkgs:
|
||||||
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
|
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
|
||||||
force: yes
|
|
||||||
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}"
|
- name: "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}"
|
||||||
force: yes
|
|
||||||
- name: "{{ docker_versioned_pkg[docker_version | string] }}"
|
- name: "{{ docker_versioned_pkg[docker_version | string] }}"
|
||||||
force: yes
|
|
||||||
|
|
||||||
docker_repo_key_info:
|
docker_repo_key_info:
|
||||||
pkg_key: apt_key
|
pkg_key: apt_key
|
||||||
|
|
Loading…
Reference in a new issue