mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-01-31 17:19:17 -03:30
containerd,docker: stop installing extras repo on CentOS/RHEL (#7203)
This was introduced in 143e2272ff
Extra repo is enabled by default in CentOS, and is not the right repo for EL8
Instead of adding a CentOS repo to RHEL, enable the needed RHEL repos with rhsm_repository
For RHEL 7, we need the "extras" repo for container-selinux
For RHEL 8, we need the "appstream" repo for container-selinux, ipvsadm and socat
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
This commit is contained in:
committed by
GitHub
parent
1a409dc7ae
commit
8f2b0772f9
@@ -34,9 +34,6 @@ containerd_repo_key_info:
|
||||
containerd_repo_info:
|
||||
repos:
|
||||
|
||||
extras_rh_repo_base_url: "http://mirror.centos.org/centos/{{ ansible_distribution_major_version }}/extras/$basearch/"
|
||||
extras_rh_repo_gpgkey: "http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7"
|
||||
|
||||
# Ubuntu docker-ce repo
|
||||
containerd_ubuntu_repo_base_url: "https://download.docker.com/linux/ubuntu"
|
||||
containerd_ubuntu_repo_gpgkey: 'https://download.docker.com/linux/ubuntu/gpg'
|
||||
|
||||
@@ -30,24 +30,3 @@
|
||||
src: "rh_containerd.repo.j2"
|
||||
dest: "{{ yum_repo_dir }}/containerd.repo"
|
||||
when: ansible_distribution in ["CentOS","RedHat"]
|
||||
|
||||
- name: check if container-selinux is available
|
||||
yum:
|
||||
list: "container-selinux"
|
||||
register: yum_result
|
||||
when: ansible_distribution in ["CentOS","RedHat"]
|
||||
|
||||
- name: Configure extras repository on RedHat/CentOS if container-selinux is not available in current repos
|
||||
yum_repository:
|
||||
name: extras
|
||||
description: "CentOS-{{ ansible_distribution_major_version }} - Extras"
|
||||
state: present
|
||||
baseurl: "{{ extras_rh_repo_base_url }}"
|
||||
file: "extras"
|
||||
gpgcheck: "{{ 'yes' if extras_rh_repo_gpgkey else 'no' }}"
|
||||
gpgkey: "{{ extras_rh_repo_gpgkey }}"
|
||||
keepcache: "{{ containerd_rpm_keepcache | default('1') }}"
|
||||
proxy: " {{ http_proxy | default('_none_') }}"
|
||||
when:
|
||||
- ansible_distribution in ["CentOS","RedHat"]
|
||||
- yum_result.results | length == 0
|
||||
|
||||
@@ -32,9 +32,6 @@ docker_ubuntu_repo_gpgkey: 'https://download.docker.com/linux/ubuntu/gpg'
|
||||
docker_debian_repo_base_url: "https://download.docker.com/linux/debian"
|
||||
docker_debian_repo_gpgkey: 'https://download.docker.com/linux/debian/gpg'
|
||||
docker_bin_dir: "/usr/bin"
|
||||
# CentOS/RedHat Extras repo
|
||||
extras_rh_repo_base_url: "http://mirror.centos.org/centos/{{ ansible_distribution_major_version }}/extras/$basearch/"
|
||||
extras_rh_repo_gpgkey: "http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7"
|
||||
|
||||
# flag to enable/disable docker cleanup
|
||||
docker_orphan_clean_up: false
|
||||
|
||||
@@ -85,27 +85,6 @@
|
||||
dest: "{{ yum_repo_dir }}/docker-ce.repo"
|
||||
when: ansible_distribution in ["CentOS","RedHat","OracleLinux"] and not is_ostree
|
||||
|
||||
- name: check if container-selinux is available
|
||||
yum:
|
||||
list: "container-selinux"
|
||||
register: yum_result
|
||||
when: ansible_distribution in ["CentOS","RedHat"] and not is_ostree
|
||||
|
||||
- name: Configure extras repository on RedHat/CentOS if container-selinux is not available in current repos
|
||||
yum_repository:
|
||||
name: extras
|
||||
description: "CentOS-{{ ansible_distribution_major_version }} - Extras"
|
||||
state: present
|
||||
baseurl: "{{ extras_rh_repo_base_url }}"
|
||||
file: "extras"
|
||||
gpgcheck: "{{ 'yes' if extras_rh_repo_gpgkey else 'no' }}"
|
||||
gpgkey: "{{ extras_rh_repo_gpgkey }}"
|
||||
keepcache: "{{ docker_rpm_keepcache | default('1') }}"
|
||||
proxy: " {{ http_proxy | default('_none_') }}"
|
||||
when:
|
||||
- ansible_distribution in ["CentOS","RedHat"] and not is_ostree
|
||||
- yum_result.results | length == 0
|
||||
|
||||
- name: Remove dpkg hold
|
||||
dpkg_selections:
|
||||
name: "{{ item }}"
|
||||
|
||||
Reference in New Issue
Block a user