我有以下定义:
class nginx::install{ ... } class nginx::service{ ... } class nginx::config{ ... } class nginx{ include nginx::install,nginx::service,nginx::config } class jenkins::nginx{ include nginx file{'/etc/nginx/sites-enabled/jenkins': source => ...,require => Class['nginx'],} }
但是当我运行它时,Puppet告诉我,我有一个循环:
err: Could not apply complete catalog: Found 1 dependency cycle: (Class[Jenkins::Nginx] => File[/etc/nginx/sites-available/jenkins] => Class[Jenkins::Nginx]) Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
jenkins :: nginx中对nginx的简单引用引用了它自己.我怎么告诉Puppet我依赖顶级nginx类呢?
我试图将我的依赖项更改为Class [‘:: nginx’](好像我在Ruby中),而Puppet现在告诉我它无法找到依赖项.
做了大量的测试,你的问题很有意思……
一段时间后发现这篇文章:
http://www.mail-archive.com/puppet-users@googlegroups.com/msg08224.html
我同意海报这是一个错误,或者至少没有很好的设计,但如果你包含具有绝对范围的类(:: nginx),你可以设置一个需要它,如下所示:
class jenkins::nginx{ include ::nginx file{'/etc/nginx/sites-enabled/jenkins': source => ...,require => Class['::nginx'],} }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。