Browse Source

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)
pull/7221/head
Etienne Champetier 3 years ago
committed by Kubernetes Prow Robot
parent
commit
b80f612d29
10 changed files with 4 additions and 28 deletions
  1. 7
      roles/container-engine/containerd/tasks/containerd_repo.yml
  2. 1
      roles/container-engine/containerd/vars/debian.yml
  3. 4
      roles/container-engine/containerd/vars/redhat.yml
  4. 4
      roles/container-engine/containerd/vars/suse.yml
  5. 1
      roles/container-engine/containerd/vars/ubuntu.yml
  6. 5
      roles/container-engine/docker/tasks/main.yml
  7. 1
      roles/container-engine/docker/vars/debian.yml
  8. 4
      roles/container-engine/docker/vars/redhat.yml
  9. 4
      roles/container-engine/docker/vars/suse.yml
  10. 1
      roles/container-engine/docker/vars/ubuntu.yml

7
roles/container-engine/containerd/tasks/containerd_repo.yml

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

1
roles/container-engine/containerd/vars/debian.yml

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

4
roles/container-engine/containerd/vars/redhat.yml

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

4
roles/container-engine/containerd/vars/suse.yml

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

1
roles/container-engine/containerd/vars/ubuntu.yml

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

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

@ -67,12 +67,11 @@
when: ansible_pkg_mgr == 'apt'
- name: ensure docker-ce repository is enabled
action: "{{ docker_repo_info.pkg_repo }}"
args:
apt_repository:
repo: "{{ item }}"
state: present
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
template:

1
roles/container-engine/docker/vars/debian.yml

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

4
roles/container-engine/docker/vars/redhat.yml

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

4
roles/container-engine/docker/vars/suse.yml

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

1
roles/container-engine/docker/vars/ubuntu.yml

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

Loading…
Cancel
Save