这两天在学习puppet,centos6.5下载了puppet3.8.7版本,但手动注册的时候各种报错:
Exiting; failed to retrieve certificate and waitforcert is disabled
关于puppet找到一篇写的很好的文章:
https://blog.51cto.com/superleedo/1900417
遇到puppet agent --test出现告警的时候,建议逐步排查:
1.检查防火墙,selinux;ping域名是否正常;/etc/resolv.conf需要注释或删除search部分;
2.检查客户端的puppet.conf文件,[main]区域要有server = puppetmaster,puppetmaster为server主机名。
在server端使用 puppet cert --clean ****删除特定证书,在客户端清空/var/lib/puppet/ssl下的文件。然后重新生成证书。使用puppet cert --list --all server端查看证书。
3.注意/etc/puppet/manifests/site.pp,node后面的客户端主机名需要加单引号,不然也会引起告警:
node 'puppetclient' {
file { 'helloworld':
path => '/etc/helloworld.txt',
owner => 'root',
group => 'root',
mode => '655',
content => "hello world from puppet!\n",
}
}
执行成功的结果:
[root@puppetclient puppet]# puppet agent --test
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for puppetclient
Info: Applying configuration version '1551159635'
Notice: /Stage[main]/Main/Node[puppetclient]/File[helloworld]/ensure: defined content as '{md5}c3aa68786c58c94ef6f3e2399920f268'
Notice: Finished catalog run in 0.03 seconds