在木偶中指定源代码似乎不起作用

我一直在尝试创build一个在Centos 5服务器上使用puppet安装postgres 9.1的清单。 我一直在尝试修改http://wiki.postgresql.org/wiki/YUM_Installation上的说明,以便实现这一点,并且当我通过手动过程时,我已经能够。

因此,在我看来,这是一个傀儡清单

package { 'postgresql91-server': ensure => installed, source => 'http://yum.postgresql.org/9.1/redhat/rhel-5-x86_64/pgdg-centos91-9.1-4.noarch.rpm' } 

但是试图应用这个清单我得到

 err: /Stage[main]//Package[postgresql91-server]/ensure: change from absent to present failed: Could not find package postgresql91-server 

那里有什么专家木偶能够帮助我?

添加回购yum(当然使用木偶),然后指定回购资源作为包的依赖。 这将使以后更容易升级。 有关更多信息,请参阅yum repos上的木偶文档。

感谢Steve和Paul的帮助。 我使用的最终代码是

 yumrepo { "postgres": baseurl => "http://yum.postgesql.org/9.1/redhat/rhel-5x86_64/", descr => "Postgres 9.1 repository", enabled => 1, gpgcheck => 1 } package { 'postgresql91-server' : ensure => installed, } 

这是诀窍!

根据http://docs.puppetlabs.com/references/stable/type.html#package ,源代码依赖于支持它的底层包提供程序。 据我所知,百胜不允许任意的URL – 你必须指定一个回购(如史蒂夫威尔斯提到)。

你可以通过为这个包资源指定'provider =>“rpm”'来解决这个问题,但是我自己没有尝试过。