From a87c572b96a1cf62b25018fb60927fe4791b897f Mon Sep 17 00:00:00 2001 From: Michal Fojtik Date: Thu, 13 Oct 2016 14:44:43 +0200 Subject: [PATCH] Use OpenShift EPEL mirror instead of official EPEL --- .../action/create_yum_repositories.rb | 10 +++------- .../action/install_origin_base_dependencies.rb | 5 +++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/vagrant-openshift/action/create_yum_repositories.rb b/lib/vagrant-openshift/action/create_yum_repositories.rb index 57901829..35f13cb9 100644 --- a/lib/vagrant-openshift/action/create_yum_repositories.rb +++ b/lib/vagrant-openshift/action/create_yum_repositories.rb @@ -54,12 +54,9 @@ def call(env) sudo(env[:machine], "yum clean all") unless is_fedora - unless env[:machine].communicate.test("rpm -q epel-release") - sudo(env[:machine], "yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-8.noarch.rpm") - - #Workaround broken RHEL image which does not recover after restart. - if "VagrantPlugins::AWS::Provider" == env[:machine].provider.class.to_s - remote_write(env[:machine], "/etc/rc.local") { + #Workaround broken RHEL image which does not recover after restart. + if "VagrantPlugins::AWS::Provider" == env[:machine].provider.class.to_s + remote_write(env[:machine], "/etc/rc.local") { %{#!/bin/sh # # This script will be executed *after* all the other init scripts. @@ -79,7 +76,6 @@ def call(env) fi }} sudo env[:machine], "chmod og+x /etc/rc.local" - end end end diff --git a/lib/vagrant-openshift/action/install_origin_base_dependencies.rb b/lib/vagrant-openshift/action/install_origin_base_dependencies.rb index ea1a50ad..c36a26f7 100644 --- a/lib/vagrant-openshift/action/install_origin_base_dependencies.rb +++ b/lib/vagrant-openshift/action/install_origin_base_dependencies.rb @@ -148,6 +148,11 @@ def call(env) sudo(env[:machine], %{ set -ex +if [[ ! -e /etc/fedora-release ]]; then +curl -s https://mirror.openshift.com/mirror/epel/epel7.repo > /etc/yum.repos.d/epel-openshift.repo +echo 'OS_BUILD_IMAGE_ARGS="--mount /etc/yum.repos.d/epel-openshift.repo:/etc/yum.repos.d/epel.repo"' >> /etc/environment +fi + if [[ -e /etc/redhat-release && ! -e /etc/fedora-release && ! -e /etc/centos-release ]]; then # create rhaos3.1 and 3.2 repos