无法在流浪傀儡中获得金属链接

时间:2015-03-25 07:08:55

标签: vagrant puppet

我的流浪档案有以下傀儡内容。

yumrepo { "epel":
 enabled => '1'
}

$req_packages = [ "java-1.7.0-openjdk", "htop", "mysql-server", "php-devel", "mongo"]
package {
 $req_packages :
 ensure => "installed",
 require => Yumrepo[ "epel" ],
}

所有与yum相关的操作都会出现类似的错误消息。

==> default: Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install mongo' returned 1: Error: Nothing to do
==> default: Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 error was
==> default: 14: problem making ssl connection
==> default: 
==> default: Error: /Stage[main]//Package[mongo]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install mongo' returned 1: Error: Nothing to do
==> default: Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 error was
==> default: 14: problem making ssl connection

我正在使用config.vm.box = "centos63"

我可以知道,我该如何解决上述问题?

我甚至尝试禁用ssl验证。但是,我仍然得到同样的错误。

yumrepo { "epel":
 enabled => '1',
 sslverify => False,
}

1 个答案:

答案 0 :(得分:0)

禁用与 EPEL(Enterprise Linux的额外软件包)的SSL连接可以解决问题。

exec { "disable ssl":
 path => ["/usr/bin", "/bin"],
 command => "sudo sed -i \"s/mirrorlist=https/mirrorlist=http/\" /etc/yum.repos.d/epel.repo",
 user => 'vagrant',
 group => 'vagrant',
}

yumrepo { "epel":
 enabled => '1',
 sslverify => False,
 require => Exec[ "disable ssl" ],
}

注意,更改/etc/yum.repos.d/epel.repo的内容是解决此问题的关键。实际上并不需要sslverify标志。但是,我认为把它留在那里没有坏处。