一、查看信息1、查看puppet版本12[root@puppet ~]# puppet –version3.7.12、查看模块位置12[root@puppet ~]# puppet config print modulepath
/etc/puppet/modules:/usr/share/puppet/modules3、查看报告1234567891011121314151617181920[root@puppet ~]# puppet agent -t –summarize
Info: Retrieving pluginfactsInfo: Retrieving pluginInfo: Caching catalog for puppet.ewin.comInfo: Applying configuration version 1415922617
Notice: Finished catalog run in 0.07 secondsChanges:Events:Resources: Total: 8Time: Filebucket: 0.00
File: 0.00 Schedule: 0.00 Config retrieval: 0.41 Total: 0.41 Last run: 1415929219
Version: Config: 1415922617 Puppet: 3.7.14、查看客户端更新间隔12[root@puppet ~]# puppet agent –configprint runinterval
1800默认1800秒,即半小时,更新间隔可修改puppet.conf1runinterval = 1205、查看请求证书1[root@puppet ~]# ls /var/lib/puppet/ssl/ca/requests/
6、查看已签证书123[root@puppet ~]# ls /var/lib/puppet/ssl/ca/signed/centostest.ewin.com.pem ywzhou-pc.ewin.com.pem
puppet.ewin.com.pem zabbix.ewin.com.pem7、服务端查看证书1234[root@puppet ~]# puppet cert list –all+ “puppet.ewin.com” (SHA256) 72:FD:30:87:86:CD:3E:CB:F4:6D:2A:C9:22:95:15:9B:48:C6:82:94:76:47:E0:08:57:A9:89:35:40:64:CB:F2 (alt names: “DNS:puppet”, “DNS:puppet.ewin.com”)
+ “ywzhou-pc.ewin.com” (SHA256) 29:33:6F:64:7D:98:87:FA:FB:B4:4C:E1:0B:BE:89:AB:F0:3A:3A:DA:29:11:C8:87:83:6C:4E:87:91:0E:F8:9E
+ “zabbix.ewin.com” (SHA256) 6F:1E:2B:46:2D:31:95:A2:71:59:A3:73:C4:A7:53:4B:29:91:72:65:4A:0D:32:A7:F1:6A:86:B6:D1:4A:FF:2D
二、验证测试1、服务端编写代码123456789101112[root@puppet ~]# vi /etc/puppet/manifests/site.ppnode default { case $operatingsystem {
Windows: { $file_path = C:\\helloworld.txt } /(RedHat|CentOS|Fedora|Ubuntu|Debian)/: {
$file_path = /tmp/helloworld.txt } } file { $file_path : content => “hello, world”;}}说明:设置默认节点配置,完成安装一、二后,通过参数$operatingsystem自动判断客户端系统,生成相应的helloworld.txt测试文件,并通过content定义内容。
2、客户端测试1[root@puppet ~]# puppet agent –server puppet.ewin.com –test
结论:可以看到两个客户端分别生成了文件,内容也是puppet定义好的;将文件删除,到达下一个同步时间,文件又会自动生成,测试安装成功3、问题及解决(1)插件同步问题客户端运行puppet agent -test时报错:。
1Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve information from environment production source(s) puppet://puppet.ewin.com/plugins
这是因为没有安装插件,解决方法是设置客户端和服务端的/etc/puppet.conf中的pluginsync=true 改成pluginsync=false,并重启puppetmaster或者建个插件让其同步工作起来。
(2)是否允许虚拟化问题
12[root@puppet ~]# vi /etc/puppet/manifests/site.ppPackage { allow_virtual => true, }