[main]
# 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
server = db.hgctech.com
certname = db.hgctech.com
pluginsync=false
[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所需的用户组以及用户
puppet resource group puppet ensure=present
puppet resource user puppet ensure=present gid=puppet shell='/sbin/nologin'
启动puppet
[iyunv@db puppet-3.3.2]# service puppetmaster start
Starting puppetmaster: [ OK ]
[main]
# 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
pluginsync=false
server = db.hgctech.com
[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
[iyunv@centos6-mysql-172 ~]# service puppet start
Starting puppet agent: [ OK ]
连接puppet server
在client执行
[iyunv@centos6-mysql-172 ~]# puppet agent --test
Info: Creating a new SSL key for centos6-mysql-172.hgctech.com
Info: Caching certificate for ca
Info: Creating a new SSL certificate request for centos6-mysql-172.hgctech.com
Info: Certificate Request fingerprint (SHA256): 4E:A9:15:AE:38:13:2F:B0:B9:09:44:A5:BB:C1:CD:AE:21:26:DC:1E:D6:4B:FB:7B:29:D8:93:8E:D3:A1:F2:AE
Exiting; no certificate found and waitforcert is disabled
[iyunv@db puppet-3.3.2]# puppet cert sign centos6-mysql-172.hgctech.com
Notice: Signed certificate request for centos6-mysql-172.hgctech.com
Notice: Removing file Puppet::SSL::CertificateRequest centos6-mysql-172.hgctech.com at '/var/lib/puppet/ssl/ca/requests/centos6-mysql-172.hgctech.com.pem'
在客户端重新验证是否成功
[iyunv@centos6-mysql-172 ~]# puppet agent -t
Info: Caching certificate for centos6-mysql-172.hgctech.com
Info: Caching certificate_revocation_list for ca
Info: Caching catalog for centos6-mysql-172.hgctech.com
Info: Applying configuration version '1385359029'
Info: Creating state file /var/lib/puppet/state/state.yaml
Notice: Finished catalog run in 0.05 seconds