#验证puppetserver master@/tmp/puppetserver#yum install puppetserver Loaded plugins: downloadonly, product-id, refresh-packagekit, security, subscription-manager Updating certificate-based repositories. Unable to read consumer identity Setting up Install Process Package puppetserver-1.1.3-1.el6.noarch already installed and latest version Nothing to do
#增加puppet master配置信息 vi /etc/puppet/puppet.conf
[main] # master的主机名 server = master # master的主机名 certname = master #禁用插件同步 pluginsync = false # The Puppet log directory. # The default value is '$vardir/log'. logdir = /var/log/puppet
# Where Puppet PID files are kept. # The default value is '$vardir/run'. rundir = /var/run/puppet
# Where SSL certificates are kept. # The default value is '$confdir/ssl'. ssldir = $vardir/ssl
[agent] # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate ``puppet`` executable using the ``--loadclasses`` # option. # The default value is '$confdir/classes.txt'. classfile = $vardir/classes.txt
# Where puppetd caches the local configuration. An # extension indicating the cache format is added automatically. # The default value is '$confdir/localconfig'. localconfig = $vardir/localconfig
#验证puppet client@/tmp/puppet#yum install puppet Loaded plugins: fastestmirror, product-id, refresh-packagekit, security, subscription-manager Updating certificate-based repositories. Unable to read consumer identity Setting up Install Process Loading mirror speeds from cached hostfile Package puppet-3.8.6-1.el6.noarch already installed and latest version Nothing to do
#增加puppet client配置信息 vi /etc/puppet/puppet.conf
[main] # master的主机名 server = master # 禁用插件同步 pluginsync = false # The Puppet log directory. # The default value is '$vardir/log'. logdir = /var/log/puppet
# Where Puppet PID files are kept. # The default value is '$vardir/run'. rundir = /var/run/puppet
# Where SSL certificates are kept. # The default value is '$confdir/ssl'. ssldir = $vardir/ssl
[agent] # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate ``puppet`` executable using the ``--loadclasses`` # option. # The default value is '$confdir/classes.txt'. classfile = $vardir/classes.txt
# Where puppetd caches the local configuration. An # extension indicating the cache format is added automatically. # The default value is '$confdir/localconfig'. localconfig = $vardir/localconfig
Notice: Signed certificate request for client Notice: Removing file Puppet::SSL::CertificateRequest client at '/var/lib/puppet/ssl/ca/requests/client.pem'
Info: Caching catalog for client Info: Applying configuration version '1458888162' Notice: /Stage[main]/Main/Node[default]/File[/tmp/test.txt]/ensure: defined content as '{md5}390b4c389233b9ae38a84ff8c731a8a1' Info: Creating state file /var/lib/puppet/state/state.yaml Notice: Finished catalog run in 0.03 seconds
#Error: Could not find certificate request for client
#execute on your puppet master. puppet cert clean "yourhostnamehere"
#execute on your puppet agent. rm -f /etc/puppetlabs/puppet/ssl/certs/yourhostnamehere find /var/lib/puppet -name *yourhostnamehere* -delete puppet agent -t
#back for your puppet master puppet cert --list
#check your name certificate and sign. puppet cert --sign "yourhostnamehere"
#come back to your puppet agent and be happy :D puppet agent -t
#客户端报错提示的方法也是类似 Error: Could not request certificate: The certificate retrieved from the master does not match the agent's private key. To fix this, remove the certificate from both the master and the agent and then start a puppet run, which will automatically regenerate a certficate. On the master: puppet cert clean "client" On the agent: 1a. On most platforms: find /var/lib/puppet/ssl -name client.pem -delete 1b. On Windows: del "/var/lib/puppet/ssl/client.pem" /f 2. puppet agent -t #Error: Could not run: Could not create PID file: /var/run/puppet/master.pid killall puppet puppet master --verbose --no-daemonize #puppet agent --test Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Permission denied - /etc/puppet/manifests/site.pp on node client.cffex.com.cn Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run #注意/etc/puppet/manifests的权限