首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在安装软件包之前,木偶包括所有存储库。

在安装软件包之前,木偶包括所有存储库。
EN

Stack Overflow用户
提问于 2014-12-31 09:06:17
回答 1查看 1.2K关注 0票数 0

我正在尝试从傀儡实验室的包中安装postgresql,但是我需要在我自己的存储库中使用我自己的软件包。因此,我能够指定应该安装哪个包,使用哪个服务名称,等等。然后我将删除服务器上的所有回复,让木偶安装所有的回复。我认为事情应该是这样的:

代码语言:javascript
复制
node name { 
 include repos::internal::blabla
 class {'database':
 someparameters=>somevalue,
}

因此,我认为这段代码应该在数据库之前安装所有的repos,但是即使我使用了repos::.反正也没用。这就是我得到的:

代码语言:javascript
复制
Debug: Prefetching yum resources for package
Debug: Executing '/bin/rpm --version'
Debug: Executing '/bin/rpm -qa --nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n''
Debug: Executing '/bin/rpm -q postgresql91 --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n'
Debug: Executing '/usr/bin/yum -d 0 -e 0 -y list postgresql91'
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y list postgresql91' returned 1: Error: No matching Packages to list
Error: /Stage[main]/Postgresql::Client/Package[postgresql-client]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y list postgresql91' returned 1: Error: No matching Packages to list
Debug: Executing '/bin/rpm -q postgresql91-server --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n'
Debug: Executing '/usr/bin/yum -d 0 -e 0 -y list postgresql91-server'
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y list postgresql91-server' returned 1: Error: No matching Packages to list
Error: /Stage[main]/Postgresql::Server::Install/Package[postgresql-server]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y list postgresql91-server' returned 1: Error: No matching Packages to list
Debug: Prefetching inifile resources for yumrepo
Notice: /Stage[main]/Repos::Internal::Integration/Yumrepo[official-repository]/ensure: created
Info: changing mode of /etc/yum.repos.d/official-repository.repo from 600 to 644
Debug: /Stage[main]/Repos::Internal::Integration/Yumrepo[official-repository]: The container Class[Repos::Internal::Integration] will propagate my refresh event
Notice: /Stage[main]/Repos::Internal::Integration/Yumrepo[commonfor91]/ensure: created
Info: changing mode of /etc/yum.repos.d/commonfor91.repo from 600 to 644
Debug: /Stage[main]/Repos::Internal::Integration/Yumrepo[commonfor91]: The container Class[Repos::Internal::Integration] will propagate my refresh event
Notice: /Stage[main]/Repos::Internal::Integration/Yumrepo[epel-6]/ensure: created
Info: changing mode of /etc/yum.repos.d/epel-6.repo from 600 to 644
Debug: /Stage[main]/Repos::Internal::Integration/Yumrepo[epel-6]: The container Class[Repos::Internal::Integration] will propagate my refresh event

怎么了?提前谢谢。我在红帽上用木偶3.7.3。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-01-01 19:01:28

类之间的关系是构建的,但这是不够的,因为关系通常不会跨类包括边界。

错误: /Stagemain/Postgresql::Server::Install/Packagepostgresql-server/ensure:从缺席更改为当前失败:执行'/usr/bin/yum -d 0 -e 0 -y list postgresql91 91-server‘返回1:错误:没有要列出的匹配包

请注意,这个package是由Class[postgresql::server::install]而不是Class['database']编写的。前者被后者直接或间接地包括在内。但是排序规则不适用于包含的类(如果是这样的话,那么复杂的清单将是非常有害的)。

若要使依赖项至少在您自己的模块范围内工作,请尝试使用

代码语言:javascript
复制
contain postgresql

在您的database模块中而不是

代码语言:javascript
复制
include postgresql

如果您需要将参数传递给postgresql模块,请考虑通过希拉进行此操作。

原始答案在2015-01-02更新之前。

表达你想要的东西有很多种方法。最直截了当的:

代码语言:javascript
复制
Yumrepo<| |> -> Class['database']

请注意,这将实现您可能使用的任何虚拟yumrepo资源。如果这是你不能接受的,你可以更有选择性。

代码语言:javascript
复制
Class['repos::internal::blabla'] -> Class['database']

其基础是链子运算符。它应该会让你在某种程度上像上面描述的那样。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27718737

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档