[root@client1 puppet-2.7.14]# puppetd --mkusers
Could not prepare for execution: Got 1 failure(s) while initializing: change from absent to present failed: Could not create user puppet: Execution of '/usr/sbin/useradd -g puppet -M puppet' returned 3: useradd: invalid numeric argument 'puppet'</p> <p>[root@client1 puppet-2.7.14]# groupadd puppet;useradd -g puppet -M puppet
[root@client1 puppet-2.7.14]# service puppet start
Starting puppet: [ OK ]
测试解析与puppetmaster端口是否畅通
代码如下:
[root@client1 puppet-2.7.14]# telnet puppetmaster.info.com 8140
Trying 192.168.0.12...
Connected to puppetmaster.info.com (192.168.0.12).
Escape character is '^]'.</p> <p>[root@client1 puppet-2.7.14]# puppetd --test --server puppetmaster.info.com
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for ca
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
info: Creating a new SSL certificate request for client1.info.com
info: Certificate Request fingerprint (md5): 07:C9:D4:43:3C:3E:D6:D1:0A:B1:8B:71:DB:6B:9D:FE
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
warning: peer certificate won't be verified in this SSL session
Exiting; no certificate found and waitforcert is disabled
# puppetd --test --server puppetmaster.info.com命令是指puppetd 从 puppetmaster.info.com去读取
puppetca -s -a
也可以在puppetmaster端的puppet.conf加入这行:
autosign = true
服务端就自动签证书
回到客户端操作,从服务端取回已批准的证书
代码如下:
[root@client1 puppet-2.7.14]# puppetd --test --server puppetmaster.info.com
warning: peer certificate won't be verified in this SSL session
info: Caching certificate for client1.info.com
info: Caching certificate_revocation_list for ca
info: Caching catalog for client1.info.com
info: Applying configuration version '1378188531
[root@puppetmaster ~]# service puppetmaster restart
Stopping puppetmaster: [ OK ]
Starting puppetmaster: [ OK ]
客户端:
代码如下:
[root@client1 puppet-2.7.14]# puppetd --test --server puppetmaster.info.com
info: Caching catalog for client1.info.com
info: Applying configuration version '1378190404'
notice: /Stage[main]//Node[default]/File[/tmp/viong.txt]/ensure: defined content as '{md5}4750aa5be82dae5db286a5859700dd51'
notice: Finished catalog run in 0.03 seconds
如果报错
[root@client1 puppet-2.7.14]# puppetd --test --server puppetmaster.info.com
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Syntax error at end of file; expected '}' at /etc/puppet/manifests/site.pp:4 on node client1.info.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
可能是/etc/puppet/manifests/site.pp 这个文件书写格式有问题。
在客户端查看:
代码如下: