puppet安装及测试

转自http://lansgg.blog.51cto.com/5675165/1299604

系统:    CentOS6.4x64

master端:

[root@puppet-m ~]# hostname
puppet-m
[root@puppet-m ~]# tail -2 /etc/hosts
192.168.3.53	puppet-m
192.168.3.54	puppet-s
[root@puppet-m ~]# ip a |grep eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet 192.168.3.53/24 brd 192.168.3.255 scope global eth0

client端:

[root@puppet-s ~]# hostname
puppet-s
[root@puppet-s ~]# tail -2 /etc/hosts
192.168.3.53    puppet-m
192.168.3.54    puppet-s
[root@puppet-s ~]# ip a |grep eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    inet 192.168.3.54/24 brd 192.168.3.255 scope global eth0

开始安装puppet(注意安装selinux和iptables)

master 端:

[root@puppet-m ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@puppet-m ~]# sed -i 's@#b@b@g' /etc/yum.repos.d/epel.repo
[root@puppet-m ~]# sed  -i 's@mirrorlist@#mirrorlist@g' /etc/yum.repos.d/epel.repo
[root@puppet-m ~]# yum install puppet-server -y
[root@puppet-m ~]# vim /etc/puppet/puppet.conf 
[root@puppet-m ~]# vim /etc/puppet/puppet.conf
    autosign = true    #新增自动签证client端的注册信息
[root@puppet-m ~]# chkconfig puppetmaster on
[root@puppet-m ~]# service puppetmaster start
Starting puppetmaster:                                     [  OK  ]
[root@puppet-m ~]# chkconfig puppet on
[root@puppet-m ~]# service puppet start
Starting puppet:                                           [  OK  ]

#查看证书
[root@puppet-m ~]# puppet cert list --all
+ "puppet-m" (85:05:DE:90:36:99:BC:5A:FD:4A:B6:C2:9F:89:7D:25)

client端:

[root@puppet-s ~]# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@puppet-s ~]# sed -i 's@#b@b@g' /etc/yum.repos.d/epel.repo
[root@puppet-s ~]# sed  -i 's@mirrorlist@#mirrorlist@g' /etc/yum.repos.d/epel.repo
[root@puppet-s ~]# yum install puppet -y
[root@puppet-s ~]# chkconfig puppet on
[root@puppet-s ~]# service puppet start
Starting puppet:                                           [  OK  ]

客户端申请证书

[root@puppet-s ~]# puppet agent --server=puppet-m --no-daemonize --onetime --verbose --debug
#输出信息如下
Debug: Finishing transaction 69982568075580
Info: Caching certificate for ca
Info: Creating a new SSL certificate request for node08.chenshake.com
Info: Certificate Request fingerprint (SHA256): DC:BF:4A:B7:65:9F:8D:80:79:42:B3:1D:94:B6:D9:
A7:1B:99:38:EB:49:DA:13:1E:E2:CE:56:5C:78:CC:12:53
Debug: Using cached certificate for ca
Debug: Using cached certificate for ca
Exiting; no certificate found and waitforcert is disabled

puppet-m接受证书



你可能感兴趣的:(puppet安装及测试)