containerd,docker: use apt_repository instead of action

yum_repository expect really different params, so nothing to factor here
Ubuntu is not an ansible_os_family, the OS family for Ubuntu is Debian
Check for ansible_pkg_mgr == apt

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit a8e51e686e)
This commit is contained in:
Etienne Champetier 2021-01-08 16:51:06 -05:00 committed by Kubernetes Prow Robot
parent 5e06ee6ea6
commit b80f612d29
10 changed files with 4 additions and 28 deletions

View file

@ -13,14 +13,11 @@
when: ansible_pkg_mgr == 'apt' when: ansible_pkg_mgr == 'apt'
- name: ensure containerd repository is enabled - name: ensure containerd repository is enabled
action: "{{ containerd_repo_info.pkg_repo }}" apt_repository:
args:
repo: "{{ item }}" repo: "{{ item }}"
state: present state: present
with_items: "{{ containerd_repo_info.repos }}" with_items: "{{ containerd_repo_info.repos }}"
when: when: ansible_pkg_mgr == 'apt'
- ansible_os_family in ['Ubuntu', 'Debian']
- containerd_repo_info.repos|length > 0
- name: Configure containerd repository on Fedora - name: Configure containerd repository on Fedora
template: template:

View file

@ -9,7 +9,6 @@ containerd_repo_key_info:
- '{{ containerd_debian_repo_repokey }}' - '{{ containerd_debian_repo_repokey }}'
containerd_repo_info: containerd_repo_info:
pkg_repo: apt_repository
repos: repos:
- > - >
deb {{ containerd_debian_repo_base_url }} deb {{ containerd_debian_repo_base_url }}

View file

@ -3,7 +3,3 @@ containerd_package_info:
enablerepo: "docker-ce" enablerepo: "docker-ce"
pkgs: pkgs:
- "{{ containerd_versioned_pkg[containerd_version | string] }}" - "{{ containerd_versioned_pkg[containerd_version | string] }}"
containerd_repo_info:
pkg_repo: ''
repos: []

View file

@ -5,7 +5,3 @@ containerd_package: containerd
containerd_package_info: containerd_package_info:
pkgs: pkgs:
- "{{ containerd_package }}" - "{{ containerd_package }}"
containerd_repo_info:
pkg_repo: ''
repos: []

View file

@ -9,7 +9,6 @@ containerd_repo_key_info:
- '{{ containerd_ubuntu_repo_repokey }}' - '{{ containerd_ubuntu_repo_repokey }}'
containerd_repo_info: containerd_repo_info:
pkg_repo: apt_repository
repos: repos:
- > - >
deb {{ containerd_ubuntu_repo_base_url }} deb {{ containerd_ubuntu_repo_base_url }}

View file

@ -67,12 +67,11 @@
when: ansible_pkg_mgr == 'apt' when: ansible_pkg_mgr == 'apt'
- name: ensure docker-ce repository is enabled - name: ensure docker-ce repository is enabled
action: "{{ docker_repo_info.pkg_repo }}" apt_repository:
args:
repo: "{{ item }}" repo: "{{ item }}"
state: present state: present
with_items: "{{ docker_repo_info.repos }}" with_items: "{{ docker_repo_info.repos }}"
when: not (ansible_os_family in ["Flatcar Container Linux by Kinvolk", "RedHat", "Suse", "ClearLinux"] or is_ostree) and (docker_repo_info.repos|length > 0) when: ansible_pkg_mgr == 'apt'
- name: Configure docker repository on Fedora - name: Configure docker repository on Fedora
template: template:

View file

@ -26,7 +26,6 @@ docker_repo_key_info:
- 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 - 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
docker_repo_info: docker_repo_info:
pkg_repo: apt_repository
repos: repos:
- > - >
deb {{ docker_debian_repo_base_url }} deb {{ docker_debian_repo_base_url }}

View file

@ -22,7 +22,3 @@ docker_package_info:
- "{{ containerd_versioned_pkg[containerd_version | string] }}" - "{{ containerd_versioned_pkg[containerd_version | string] }}"
- "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}" - "{{ docker_cli_versioned_pkg[docker_cli_version | string] }}"
- "{{ docker_versioned_pkg[docker_version | string] }}" - "{{ docker_versioned_pkg[docker_version | string] }}"
docker_repo_info:
pkg_repo: ''
repos: []

View file

@ -4,7 +4,3 @@ docker_package_info:
pkgs: pkgs:
- docker - docker
- containerd - containerd
docker_repo_info:
pkg_repo: ''
repos: []

View file

@ -26,7 +26,6 @@ docker_repo_key_info:
- 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 - 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
docker_repo_info: docker_repo_info:
pkg_repo: apt_repository
repos: repos:
- > - >
deb [arch={{ host_architecture }}] {{ docker_ubuntu_repo_base_url }} deb [arch={{ host_architecture }}] {{ docker_ubuntu_repo_base_url }}