我是木偶新手 – 我一直在玩基本知识。 在puppet页面上的大多数例子(除了非常基本的例子)都不适用于我 – 要么是某些依赖项丢失,要么是没有find包。 我没有看到日志解释出了什么问题(即使我运行--test或--verbose选项)
任何人都可以澄清如何傀儡pipe理从标题安装任何给定的包(例如从一个清单开始,如下所示:
class httpd { package { 'httpd': ensure => installed, } }
这里 – 从'httpd'开始 – 当我们运行木偶时会发生什么情况,适用于这个清单? 它在哪里find安装程序(即在哪里存储库 – 它在哪里configuration?)
具体来说,我得到这个错误:
err: /Stage[main]/Ntp/Package[httpd]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install httpd' returned 1: Error: failure: repodata/filelists.xml.gz from base: [Errno 256] No more mirrors to try. You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest
我怎样才能解决这个问题 ?
它试图运行yum来安装httpd
/usr/bin/yum -d 0 -e 0 -y install httpd
尝试以root身份运行,但我相信它会失败,所以尝试
/usr/bin/yum clean all /usr/bin/yum -d 0 -e 0 -y install httpd
如果这不起作用,你的yum版本库不能正常工作,所以你必须修复这个文件。 可能在文件中
/etc/yum.repos.d
虽然Mike的答案肯定能解决问题,但我会通过Puppet做类似的事情。
例如,作为第一步,我会在安装任何软件包之前添加下面的一段代码
exec {'yum-clean-all': command => 'yum clean all', path => '/usr/bin', user => 'root', before => Package[httpd], }
同样,在安装包之前需要完成的任何执行都应该通过木偶来执行,作为第一步。