Puppet 错误:无法应用完整的目录:找到1个依赖项循环
运行以下命令时:Puppet 错误:无法应用完整的目录:找到1个依赖项循环,puppet,Puppet,运行以下命令时: 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 '.do
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']
}
}
class site1 {
include apache2
include essentials
include mysql
include python2
include postfix
}
/etc/puppet/manifests/sites.pp/site1.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']
}
}
class site1 {
include apache2
include essentials
include mysql
include python2
include postfix
}
在任何其他模块中都没有提到后缀,删除include postfix
允许完整的puppet应用程序继续进行,因此我假设它是自包含的
我还尝试删除模板并将占位符内容放在模块本身中,以保持不变。出于某种原因,您使用的路径与资源名称不同。这会导致自动包含self和循环依赖
file { '/etc/postfix' :
ensure=>directory
}
file { '/etc/postfix/main.cf':
ensure => present,
content => template("postfix/main.cf.erb"),
subscribe => Package['postfix']
}
将解决您的问题由于某些原因,您使用的路径与资源名称不同。这会导致自动包含self和循环依赖
file { '/etc/postfix' :
ensure=>directory
}
file { '/etc/postfix/main.cf':
ensure => present,
content => template("postfix/main.cf.erb"),
subscribe => Package['postfix']
}
会解决你的问题