无法在 vagrant puppet 中获取元链接

Could not get metalink in vagrant puppet

我的 vagrant 文件有以下木偶内容。

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,
}

禁用与 EPEL 的 SSL 连接(企业附加包 Linux) 即可。

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 标志并不是真正需要的。但是,我认为把它留在那里没有什么坏处。