provisioners/docker: Check if epel-release is installed on RedHat-ian guests before attempting installation [GH-2649]

This commit is contained in:
Fabio Rehm 2013-12-13 22:28:51 -02:00
parent 2141e2e9e7
commit 5a842fc609
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,9 @@ module VagrantPlugins
module DockerInstall module DockerInstall
def self.docker_install(machine, version) def self.docker_install(machine, version)
machine.communicate.tap do |comm| machine.communicate.tap do |comm|
comm.sudo("rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm") if ! comm.test("rpm -qa | grep epel-release")
comm.sudo("rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm")
end
comm.sudo("yum -y upgrade") comm.sudo("yum -y upgrade")
comm.sudo("yum -y install docker-io") comm.sudo("yum -y install docker-io")
end end