我是傀儡新手,并希望避免一些常见问题,我看到并摆脱使用导入语句,因为他们被弃用。我从创建一个将文件复制到单个puppet代理的类的非常简单的任务开始。木偶类与环境目录
所以我有这样的高手:
/etc/puppet/environments/production
/etc/puppet/environments/production/modules
/etc/puppet/environments/production/mainfests
/etc/puppet/environments/production/files
我试图在一个叫nodes.pp在清单目录中的文件创建节点定义和使用,我已经定义一个类(类是test_monitor)在一个模块调用测试:
node /^web\d+.*.net/ {
include test_monitor
}
然而,当我运行木偶-t代理人在代理我得到:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class test_monitor for server on node server
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
什么是正确的方式来配置它工作。我想在一个或多个文件中拥有节点定义,这些文件可以访问我在自定义模块中构建的类。
这里是我的puppet.conf:
[main]
environmentpath = $confdir/environments
default_manifest = $confdir/environments/production/manifests
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
factpath=$vardir/lib/facter
[master]
ssl_client_header = SSL_CLIENT_S_DN
ssl_client_verify_header = SSL_CLIENT_VERIFY
我知道这可能是一些愚蠢的事,我没有做正确或者错误配置,但我似乎无法得到它的工作。任何帮助表示赞赏!要明确我只是想保持干净,并在具有特定节点类型的单独文件中的类也存在于它们自己的文件中。我有一个小到中等大小的环境。 (约150个在数据中心的服务器)
这更是一个解决办法,真的。 'environmentpath'应该满足所有常规需求。 – 2014-12-14 14:16:35
是的,你是对的,我已经从puppet.conf中删除了它。这就是我把课堂本身称为问题的方式。我按照上面的建议重新组织了模块目录,因为它似乎遵循傀儡文档的一般流程,并且对于这个项目有意义。然而,Hiera并不是必需的,我也没有实施这种改变。 – user1499 2014-12-14 21:25:18