1 服务端和客户端hosts 文件修改如下
cat /etc/hosts
127.0.0.1 localhost
10.128.129.8 tangjie.master.domain.com
10.128.128.9 tangjie.client.domain.com
2服务器端安装和配置:
rpm -ivh
yum install puppet-server
chkconfig puppetmaster on
service puppetmaster start
3添加 /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8140 -j ACCEPT
service iptables restart
4puppet cert --list --all
5puppet cert --sign tangjie.client.domain.com
6vim /etc/puppet/puppet.conf
[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
[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
server=tangjie.master.domain.com
certname=tangjie.client.domain.com
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
[master]
certname=tangjie.master.domain.com
7 touch /etc/puppet/manifests/site.pp
8/etc/init.d/puppetmaster restart
yum install tree
tree /var/lib/puppet/ssl/
puppet cert --list --all
netstat -nlatp | grep 8140
yum install lsof
lsof -i:8140
iptables -I INPUT -s 10.128.128.9 -j ACCEPT
客户端安装
1rpm -ivh
yum install puppet
chkconfig puppet on
2配置vim /etc/sysconfig/puppet
# The puppetmaster server
PUPPET_SERVER=tangjie.master.domain.com
# If you wish to specify the port to connect to do so here
#PUPPET_PORT=8140
# Where to log to. Specify syslog to send log messages to the system log.
#PUPPET_LOG=/var/log/puppet/puppet.log
# You may specify other parameters to the puppet client here
#PUPPET_EXTRA_OPTS=--waitforcert=500
[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
[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
server=tangjie.master.domain.com
certname=tangjie.client.domain.com
# Where puppetd caches the local configuration. An
# extension indicating the cache format is added automatically.
# The default value is '$confdir/localconfig'.
localconfig = $vardir/localconfig
service puppet start
3 iptables -I INPUT -s 10.128.129.8 -j ACCEPT
puppet agent --test
阅读(1433) | 评论(0) | 转发(0) |