然后签名证书
puppet:# puppetca –sign pclient.example.com
Signed pclient.example.com
如果一切, 你将在pclient客户端看到如下消息.
info: Requesting certificate
warning: peer certificate won’t be verified in this SSL session
notice: Ignoring –listen on onetime run
info: Caching configuration at /etc/puppet/localconfig.yaml
notice: Starting configuration run
notice: //pclient/test_class/File[/tmp/testfile]/ensure: created
info: Creating state file /var/lib/puppet/state/state.yaml
notice: Finished configuration run in 0.11 seconds
(注:
info: 正在请求证书 [信息]
warning: 点证书将不会在此SSL会话中被验证 [警告]
notice: 忽略 — 运行时监听 [注意]
info: 缓存配置到/etc/puppet/localconfi.yaml [信息]
notice: 开始运行配置 [注意]
notice: //pclient/test_class/File[/tmp/testfile]/ensure: 改文件被创建 [注意]
info: 创建状态文件/var/lib/puppet/state/state.yaml [信息]
notice: 完成运行配置, 耗时0.11秒 [注意] )
9. 测试
检查和确认文件是否已创建.
pclient:# ls -l /tmp/testfile
-rw-r–r– 1 root root 0 2007-02-18 18:28 /tmp/testfile
修改清单(manifest)和Puppset的文件权限模式. 修改行, “mode=>644,”为”mode=>600,”
# Create “/tmp/testfile” if it doesn’t exist.
class test_class {
file { “/tmp/testfile”:
ensure => present,
mode => 600,
owner => root,
group => root
}
}
# tell puppet on which client to run the class
node pclient {
include test_class
在客户端上以详细模式(verbose)和仅一次模式运行puppetd服务程序.
pclient:# puppetd -v -o
你将看到下面的消息, /tmp/testfile的文件权限将从644改为600.
notice: Ignoring –listen on onetime run
info: Config is up to date
notice: Starting configuration run
notice: //pclient/test_class/File[/tmp/testfile]/mode: mode changed ‘644′ to ‘600′
notice: Finished configuration run in 0.26 seconds
(注:
notice: 忽略 — 运行时监听 [注意]
info: Config配置已更新 [信息]
notice: 开始运行配置 [注意]
notice: //pclient/test_class/File[/tmp/testfile]/mode: 模式从’644′修改为’600′ [注意]
notice: 完成运行配置, 耗时0.26秒 [注意] )
然后确认工作是否正确完成.
pclient:# ls -l /tmp/testfile
-rw——- 1 root root 0 2007-02-18 18:28 /tmp/testfile
10. 结论
配置, 测试已经完成, 你已经成功安装了Puppet. 下面的步骤是创建一个功能清单, 测试更多的选项, 然后在客户端启动puppetd守护程序. 默认情况, Puppetd将会每隔30分钟自动重新启动它的配置.
pclient:# /etc/init.d/puppet start
更多信息请访问Reductive Labs网站. 如果你需要即时的帮助, 请加入Puppet Users邮件列表或者irc.freenode.net的#puppet.
原文
Configuration Automation & Centralized Management With Puppet on Ubuntu
![nixsky[www.nixsky.com]](/templets/images/toplogo.gif)

