Skip to content

Instantly share code, notes, and snippets.

@isaldarriaga
Created August 17, 2018 01:15
Show Gist options
  • Save isaldarriaga/23d586c6253d5e8347c18d74447318cb to your computer and use it in GitHub Desktop.
Save isaldarriaga/23d586c6253d5e8347c18d74447318cb to your computer and use it in GitHub Desktop.
---
# 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_version is formatted to a standard string in openshift_version role.
# openshift_version 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_version.
- 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(''))[0:3] }}.repo.j2"
- "CentOS-OpenShift-Origin.repo.j2"
notify: refresh cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment