containerd: use package instead of action

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
This commit is contained in:
Etienne Champetier 2021-01-07 11:36:03 -05:00 committed by Kubernetes Prow Robot
parent 0e96852159
commit 1b88678cf3
6 changed files with 18 additions and 22 deletions

View file

@ -92,18 +92,22 @@
when: ansible_pkg_mgr == 'apt'
- name: ensure containerd packages are installed
action: "{{ containerd_package_info.pkg_mgr }}"
args:
pkg: "{{ item.name }}"
force: "{{ item.force | default(omit) }}"
package:
name: "{{ containerd_package_info.pkgs }}"
state: present
update_cache: "{{ omit if ansible_distribution == 'Fedora' else True }}"
enablerepo: "{{ item.repo | default(omit) }}"
module_defaults:
apt:
update_cache: true
dnf:
enablerepo: "{{ containerd_package_info.enablerepo | default(omit) }}"
yum:
enablerepo: "{{ containerd_package_info.enablerepo | default(omit) }}"
zypper:
update_cache: true
register: containerd_task_result
until: containerd_task_result is succeeded
retries: 4
delay: "{{ retry_stagger | d(3) }}"
with_items: "{{ containerd_package_info.pkgs }}"
notify: restart containerd
when:
- not is_ostree

View file

@ -1,9 +1,7 @@
---
containerd_package_info:
pkg_mgr: apt
pkgs:
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
force: false
- "{{ containerd_versioned_pkg[containerd_version | string] }}"
containerd_repo_key_info:
pkg_key: apt_key

View file

@ -1,6 +1,5 @@
---
containerd_package_info:
pkg_mgr: dnf
enablerepo: "docker-ce"
pkgs:
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
repo: "docker-ce"
- "{{ containerd_versioned_pkg[containerd_version | string] }}"

View file

@ -1,9 +1,8 @@
---
containerd_package_info:
pkg_mgr: yum
enablerepo: "docker-ce"
pkgs:
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
repo: "docker-ce"
- "{{ containerd_versioned_pkg[containerd_version | string] }}"
containerd_repo_key_info:
pkg_key: ''

View file

@ -3,10 +3,8 @@
containerd_package: containerd
containerd_package_info:
pkg_mgr: zypper
pkgs:
- name: "{{ containerd_package }}"
state: latest
- "{{ containerd_package }}"
containerd_repo_key_info:
pkg_key: ''

View file

@ -1,9 +1,7 @@
---
containerd_package_info:
pkg_mgr: apt
pkgs:
- name: "{{ containerd_versioned_pkg[containerd_version | string] }}"
force: false
- "{{ containerd_versioned_pkg[containerd_version | string] }}"
containerd_repo_key_info:
pkg_key: apt_key