From 750db9139a046ac5a3539bc8e80f22aadab5cfeb Mon Sep 17 00:00:00 2001
From: spaced <spaced.wombat@gmail.com>
Date: Thu, 4 Jun 2020 10:08:44 +0200
Subject: [PATCH] fix CRI-O repos for centos distributions (#6224)

* fix CRI-O repos for centos distributions

* fix CRI-O repos for centos distributions
- revert workarounds

* fix CRI-O repos for centos distributions
- use https for centos repos

* avoid 302 redirects for centos repos
---
 roles/container-engine/cri-o/tasks/crio_repo.yml | 8 ++++----
 roles/container-engine/cri-o/vars/centos-7.yml   | 5 -----
 roles/container-engine/cri-o/vars/centos-8.yml   | 5 -----
 3 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/roles/container-engine/cri-o/tasks/crio_repo.yml b/roles/container-engine/cri-o/tasks/crio_repo.yml
index 8bd454ba8..60cfae99f 100644
--- a/roles/container-engine/cri-o/tasks/crio_repo.yml
+++ b/roles/container-engine/cri-o/tasks/crio_repo.yml
@@ -22,7 +22,7 @@
   yum_repository:
     name: devel_kubic_libcontainers_stable
     description: Stable Releases of Upstream github.com/containers packages (CentOS_$releasever)
-    baseurl: http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_$releasever/
+    baseurl: http://widehat.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_$releasever/
     gpgcheck: yes
     gpgkey: http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_$releasever/repodata/repomd.xml.key
   when: ansible_distribution in ["CentOS"]
@@ -30,10 +30,10 @@
 - name: Add CRI-O kubic repo
   yum_repository:
     name: "devel_kubic_libcontainers_stable_cri-o_{{ crio_version }}"
-    description: 1.17 (CentOS_$releasever)
-    baseurl: "http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_repo_path[crio_required_version] }}/CentOS_$releasever/"
+    description: "CRI-O {{ crio_version }} (CentOS_$releasever)"
+    baseurl: "http://widehat.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/CentOS_$releasever/"
     gpgcheck: yes
-    gpgkey: "http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_repo_path[crio_required_version] }}/CentOS_$releasever/repodata/repomd.xml.key"
+    gpgkey: "http://widehat.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/CentOS_$releasever/repodata/repomd.xml.key"
   when: ansible_distribution in ["CentOS"]
 
 - name: Enable modular repos for CRI-O
diff --git a/roles/container-engine/cri-o/vars/centos-7.yml b/roles/container-engine/cri-o/vars/centos-7.yml
index 29f69b37e..740adbc6b 100644
--- a/roles/container-engine/cri-o/vars/centos-7.yml
+++ b/roles/container-engine/cri-o/vars/centos-7.yml
@@ -3,8 +3,3 @@
 crio_packages:
   - cri-o
   - oci-systemd-hook
-
-crio_repo_path:
-  "1.18": "1.17:/1.17.4"
-  "1.17": "1.17:/1.17.4"
-  "1.16": "1.16"
\ No newline at end of file
diff --git a/roles/container-engine/cri-o/vars/centos-8.yml b/roles/container-engine/cri-o/vars/centos-8.yml
index 943b09146..121180879 100644
--- a/roles/container-engine/cri-o/vars/centos-8.yml
+++ b/roles/container-engine/cri-o/vars/centos-8.yml
@@ -2,8 +2,3 @@
 
 crio_packages:
   - cri-o
-
-crio_repo_path:
-  "1.18": "1.18:/1.18.0"
-  "1.17": "1.17:/1.17.4"
-  "1.16": "1.16"
\ No newline at end of file
-- 
GitLab