运行以下命令时:
puppet apply --verbose /etc/puppet/manifests/sites.pp/site1.pp
我收到错误:
Error: Could not apply complete catalog: Found 1 dependency cycle:
(File[/etc/postfix] => File[/etc/postfix])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
这是相关的清单/模块:
/etc/puppet/modules/postfix/manifests/init.pp:
class postfix {
package { 'postfix' :
ensure => present
}
file { '/etc/postfix' :
path => "/etc/postfix/main.cf",
ensure => present,
content => template("postfix/main.cf.erb"),
subscribe => Package['postfix']
}
}
/etc/puppet/manifests/sites.pp/site1.pp:
class site1 {
include apache2
include essentials
include mysql
include python2
include postfix
}
在任何其他模块中没有其他提及postfix,删除include postfix
允许完整的木偶申请继续,所以我认为它是自包含的。
我也尝试删除模板并将占位符内容放入模块本身,不做任何更改。
答案 0 :(得分:2)
出于某种原因,您使用的路径与资源名称不同。这导致自我的自动包含和循环依赖。
file { '/etc/postfix' :
ensure=>directory
}
file { '/etc/postfix/main.cf':
ensure => present,
content => template("postfix/main.cf.erb"),
subscribe => Package['postfix']
}
将解决您的问题