Browse Source

containerd: use copy to set apt pin

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
pull/7193/head
Etienne Champetier 3 years ago
committed by Kubernetes Prow Robot
parent
commit
19a61d838f
2 changed files with 6 additions and 8 deletions
  1. 11
      roles/container-engine/containerd/tasks/main.yml
  2. 3
      roles/container-engine/containerd/templates/apt_preferences.d/debian_containerd.j2

11
roles/container-engine/containerd/tasks/main.yml

@ -81,14 +81,15 @@
# This is required to ensure any apt upgrade will not break kubernetes
- name: Set containerd pin priority to apt_preferences on Debian family
template:
src: "apt_preferences.d/debian_containerd.j2"
copy:
content: |
Package: {{ containerd_package }}
Pin: version {{ containerd_version }}*
Pin-Priority: 1001
dest: "/etc/apt/preferences.d/containerd"
owner: "root"
mode: 0644
when:
- ansible_os_family in ['Ubuntu', 'Debian']
- not is_ostree
when: ansible_pkg_mgr == 'apt'
- name: ensure containerd packages are installed
action: "{{ containerd_package_info.pkg_mgr }}"

3
roles/container-engine/containerd/templates/apt_preferences.d/debian_containerd.j2

@ -1,3 +0,0 @@
Package: {{ containerd_package }}
Pin: version {{ containerd_version }}*
Pin-Priority: 1001
Loading…
Cancel
Save