【发布时间】:2014-09-06 09:15:32
【问题描述】:
我正在尝试创建Puppet 模块来设置我的网络服务器。
我想要的 - 是将配置拆分为逻辑模块(服务清单:webserver、database、ftp 等)但我不知道如何在 init.pp 中使用其他清单
我将仅将它与puppet apply 一起使用,而不是服务器-客户端配置。
我的文本模块清单 (kp/manifests/init.pp):
class kp {
include kp::testfile
}
include kp
以及额外的清单 (kp/manifests/testfile.pp)
define kp::testfile {
$value = template("kp/some.erb")
file { 'testfile':
path => '/tmp/my.txt',
ensure => file,
content => $value
}
}
文档说:
If a class is defined in a module, you can declare that class by name in any manifest. Puppet will automatically find and load the manifest that contains the class definition.
但是当我运行 puppet apply init.pp 时,我收到了错误消息
Could not find class kp::testfile for myhost.com at /myDir/puppetModules/kp/manifests/init.pp:2 on node vagrant.example.com
事实
-
/myDir/puppetModules/在modulepath所以这里没有问题 - 傀儡版v2.7.11
- Ubuntu 12.04 LTS
我做错了什么? 提前致谢!
【问题讨论】:
标签: puppet