Browse Source

use dpkg_selections module to hold docker-ce on Debian family hosts (#4820)

* use dpkg_selections module to hold docker-ce on Debian family hosts

* removed debian_docker.j2 template as it is no longer required
pull/4849/head
Scott Charron 5 years ago
committed by Kubernetes Prow Robot
parent
commit
bbdc6210f5
2 changed files with 5 additions and 10 deletions
  1. 12
      roles/container-engine/docker/tasks/main.yml
  2. 3
      roles/container-engine/docker/templates/apt_preferences.d/debian_docker.j2

12
roles/container-engine/docker/tasks/main.yml

@ -192,13 +192,11 @@
- ansible_distribution == 'Ubuntu' - ansible_distribution == 'Ubuntu'
# This is required to ensure any apt upgrade will not break kubernetes # This is required to ensure any apt upgrade will not break kubernetes
- name: Set docker pin priority to apt_preferences on Debian family
template:
src: "apt_preferences.d/debian_docker.j2"
dest: "/etc/apt/preferences.d/docker"
owner: "root"
mode: 0644
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS", "ClearLinux", "RedHat", "Suse"] or is_atomic)
- name: Tell Debian hosts not to change the docker version with apt upgrade
dpkg_selections:
name: docker-ce
selection: hold
when: ansible_os_family in ["Debian"]
- name: ensure docker started, remove our config if docker start failed and try again - name: ensure docker started, remove our config if docker start failed and try again
block: block:

3
roles/container-engine/docker/templates/apt_preferences.d/debian_docker.j2

@ -1,3 +0,0 @@
Package: docker-ce
Pin: version {{ docker_version }}.*
Pin-Priority: 1001
Loading…
Cancel
Save