环境 两台Centos 7 MINI 虚拟机,采用桥接模式

192.168.0.13 puppet server
192.168.0.14 puppet agent

Puppet Master

修改hostname

vi /etc/hostname
改为server.vsxen.test

修改修改hosts

vi /etc/hosts

1
2
192.168.0.13 server.vsxen.test
192.168.0.14 agent.vsxen.test

安装puppet-server

rpm -ivh https://yum.puppetlabs.com/el/7/products/x86_64/puppetlabs-release-7-11.noarch.rpm

## 修改配置

vi /etc/puppet/puppet.conf
在最后面加上

1
2
3
[master]
certname=master.server.com

启动

systemctl start puppetmaster

Puppet agent

修改hostname

vi /etc/hostname
改为agent.vsxen.test

修改修改hosts

vi /etc/hosts

1
2
192.168.0.13 server.vsxen.test
192.168.0.14 agent.vsxen.test

安装puppet

rpm -ivh https://yum.puppetlabs.com/el/7/products/x86_64/puppetlabs-release-7-11.noarch.rpm

修改配置

vi /etc/puppet/puppet.conf

在[agent]节点最后添加:

server=server.vsxen.test

启动服务

systemctl start puppet

认证

客户端执行

puppet agent -t

出现puppet error could not request certificate no route to host - connect(2)错误

关闭防火墙systemctl stop firewalld

服务端执行

puppet cert list

参考
http://yntmdr.blog.51cto.com/3829621/1592472