我正在尝试实现此处找到的配方 https://github.com/puppetlabs/puppetlabs-firewall#readme而且我似乎犯了一个我看不到的菜鸟 puppet 错误。我有一个名为 mwsettings 的模块,它本身可以找到(mwsettings/init.pp 存储了一个用于加载一些模板的助手并且可以工作),但是我的 site.pp 中的以下代码
Firewall {
notify => Exec['persist-firewall'],
before => Class['mwsettings::postfirewall'],
require => Class['mwsettings::prefirewall'],
}
爆炸了
Error: Failed to apply catalog: Could not find dependency Class[Mwsettings::Prefirewall] for Firewall[100 accept mysql - XXXXXXXX]
当我的代码稍后在 site.pp 中调用时
firewall { "100 accept mysql - $name":
proto => 'tcp',
action => 'accept',
dport => 3306,
source => $name,
}
但是,看来我已经为防火墙前正确设置了 list :
# cat modules/mwsettings/manifests/prefirewall.pp
class mwsettings::prefirewall {
Firewall {
require => undef,
}
<snip>
我是否遗漏了一些极其微不足道的东西?由于这是我的第一个 puppet 牛仔竞技表演,我什至不完全确定如何调试它。
谢谢!
最佳答案
您指的是您尚未声明的类。
如果你添加它应该可以工作:
include mwsettings::prefirewall
include mwsettings::postfirewall
关于puppet - 为什么 puppet 找不到我的类(class)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13838559/