openshift-ansible: CentOS Origin repo template for 3.10 is broken

On a clean CentOS 7 install, with centos-release-openshift-origin39 installed, prerequisites.yaml creates a second repository file at /etc/yum.repos.d/CentOS-OpenShift-Origin.repo in addition to the existing /etc/yum.repos.d/CentOS-OpenShift-Origin39.repo.

The fallback behavior is using the latest upstream repo (CentOS-OpenShift-Origin.repo), which is almost never intended. This should just outright fail vs. doing something unexpected:

https://github.com/openshift/openshift-ansible/blob/169031534be2ac34e35a99214d66f381cbbbbc29/roles/openshift_repos/tasks/centos_repos.yml#L17

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@DanyC97 @michaelgugino Why was it reverted? I suggest something slightly more robust:

CentOS-OpenShift-Origin{{ (openshift_version.split('.')[0:2] | join('')) }}.repo.j2

IMHO, we should remove the fallback and “fail hard” when there’s no matching template. We also need to fix the order of execution in the playbook to run the openshift_version role earlier.

@michaelgugino Are you sure that this is fixed? I tried #10639 and it didn’t work.

Debug statement added below “Configure correct origin release repository”:

- debug: msg="CentOS-OpenShift-Origin{{ ((openshift_version | default('')).split('.')[0:2] | join('')) }}.repo.j2"
TASK [openshift_repos : debug] *****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
Thursday 08 November 2018  15:36:23 +0100 (0:00:00.870)       0:00:29.913 ***** 
ok: [oc-dev.marbis.net] => {
    "msg": "CentOS-OpenShift-Origin.repo.j2"
}

$ cat /etc/yum.repos.d/CentOS-OpenShift-Origin.repo:

[centos-openshift-origin]
name=CentOS OpenShift Origin
baseurl=http://mirror.centos.org/centos/7/paas/x86_64/openshift-origin/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-PaaS

[centos-openshift-origin-testing]
name=CentOS OpenShift Origin Testing
baseurl=http://buildlogs.centos.org/centos/7/paas/x86_64/openshift-origin/
enabled=0
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/openshift-ansible-CentOS-SIG-PaaS

[centos-openshift-origin-debuginfo]
name=CentOS OpenShift Origin DebugInfo
baseurl=http://debuginfo.centos.org/centos/7/paas/x86_64/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/openshift-ansible-CentOS-SIG-PaaS

[centos-openshift-origin-source]
name=CentOS OpenShift Origin Source
baseurl=http://vault.centos.org/centos/7/paas/Source/openshift-origin/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/openshift-ansible-CentOS-SIG-PaaS

As stated above, it looks like openshift_version is included too late.