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' when: ansible_pkg_mgr == 'apt'
- name: ensure containerd packages are installed - name: ensure containerd packages are installed
action: "{{ containerd_package_info.pkg_mgr }}" package:
args: name: "{{ containerd_package_info.pkgs }}"
pkg: "{{ item.name }}"
force: "{{ item.force | default(omit) }}"
state: present state: present
update_cache: "{{ omit if ansible_distribution == 'Fedora' else True }}" module_defaults:
enablerepo: "{{ item.repo | default(omit) }}" 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 register: containerd_task_result
until: containerd_task_result is succeeded until: containerd_task_result is succeeded
retries: 4 retries: 4
delay: "{{ retry_stagger | d(3) }}" delay: "{{ retry_stagger | d(3) }}"
with_items: "{{ containerd_package_info.pkgs }}"
notify: restart containerd notify: restart containerd
when: when:
- not is_ostree - not is_ostree

View file

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

View file

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

View file

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

View file

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

View file

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