diff options
author | Michael Gugino <mgugino@redhat.com> | 2017-09-26 13:53:32 -0400 |
---|---|---|
committer | Michael Gugino <mgugino@redhat.com> | 2017-09-26 15:36:06 -0400 |
commit | 5964a9b34b1e68a2a965ffd1689be3eb37ba3570 (patch) | |
tree | f97502b662795d7238674efa3113bf2d8358ef2a /roles/openshift_repos/tasks/centos_repos.yml | |
parent | 4ac743b8fd26e02af6e230af2cbbe82dd2d4617a (diff) | |
download | openshift-5964a9b34b1e68a2a965ffd1689be3eb37ba3570.tar.gz openshift-5964a9b34b1e68a2a965ffd1689be3eb37ba3570.tar.bz2 openshift-5964a9b34b1e68a2a965ffd1689be3eb37ba3570.tar.xz openshift-5964a9b34b1e68a2a965ffd1689be3eb37ba3570.zip |
Fix origin repo deployment
Currently, origin deployments place a repo on nodes and
masters named centos-openshift-origin. At some point,
the maintainers of centos-openshift-origin migrated
previous releases of openshift to their own respective
repositories.
This commit provides the correct repositories for
centos-openshift-origin based on the variable openshift_release,
defaulting to the latest release reposititory (unversioned).
Fixes: https://github.com/openshift/openshift-ansible/issues/5404
Diffstat (limited to 'roles/openshift_repos/tasks/centos_repos.yml')
-rw-r--r-- | roles/openshift_repos/tasks/centos_repos.yml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/roles/openshift_repos/tasks/centos_repos.yml b/roles/openshift_repos/tasks/centos_repos.yml new file mode 100644 index 000000000..7dc15af2a --- /dev/null +++ b/roles/openshift_repos/tasks/centos_repos.yml @@ -0,0 +1,25 @@ +--- +# Note: OpenShift repositories under CentOS may be shipped through the +# "centos-release-openshift-origin" package which configures the repository. +# This task matches the file names provided by the package so that they are +# not installed twice in different files and remains idempotent. + +- name: Configure origin gpg keys + copy: + src: "origin/gpg_keys/openshift-ansible-CentOS-SIG-PaaS" + dest: "/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-PaaS" + notify: refresh cache + +# openshift_release is formatted to a standard string in openshift_version role. +# openshift_release is expected to be in format 'x.y.z...' here. +# Here, we drop the '.' characters and try to match the correct repo template +# for our corresponding openshift_release. +- name: Configure correct origin release repository + template: + src: "{{ item }}" + dest: "/etc/yum.repos.d/{{ (item | basename | splitext)[0] }}" + with_first_found: + - "CentOS-OpenShift-Origin{{ (openshift_release | default('')).split('.') | join('') }}.repo.j2" + - "CentOS-OpenShift-Origin{{ ((openshift_release | default('')).split('.') | join(''))[0:2] }}.repo.j2" + - "CentOS-OpenShift-Origin.repo.j2" + notify: refresh cache |