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>
This commit is contained in:
parent
a2429ef64d
commit
a8e51e686e
10 changed files with 4 additions and 28 deletions
|
@ -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:
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -3,7 +3,3 @@ containerd_package_info:
|
|||
enablerepo: "docker-ce"
|
||||
pkgs:
|
||||
- "{{ containerd_versioned_pkg[containerd_version | string] }}"
|
||||
|
||||
containerd_repo_info:
|
||||
pkg_repo: ''
|
||||
repos: []
|
||||
|
|
|
@ -5,7 +5,3 @@ containerd_package: containerd
|
|||
containerd_package_info:
|
||||
pkgs:
|
||||
- "{{ containerd_package }}"
|
||||
|
||||
containerd_repo_info:
|
||||
pkg_repo: ''
|
||||
repos: []
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -26,7 +26,6 @@ docker_repo_key_info:
|
|||
- 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
||||
|
||||
docker_repo_info:
|
||||
pkg_repo: apt_repository
|
||||
repos:
|
||||
- >
|
||||
deb {{ docker_debian_repo_base_url }}
|
||||
|
|
|
@ -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,7 +4,3 @@ docker_package_info:
|
|||
pkgs:
|
||||
- docker
|
||||
- containerd
|
||||
|
||||
docker_repo_info:
|
||||
pkg_repo: ''
|
||||
repos: []
|
||||
|
|
|
@ -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…
Reference in a new issue