puppet学习总结之证书自动认证

 

本文主要简单介绍puppet证书自动认证,由于手动认证比较繁琐。puppet安装这里不在说明,参考以往文档《puppet介绍及基于httpd实例部署》。

一、系统环境

系统平台:Centos6.6_x86_64

主机规划:

192.168.115.21   puppet1.hnr.com  master

192.168.115.22   puppet2.hnr.com  agent

192.168.115.23   puppet3.hnr.com  agent

二、清除原有证书

如果原客户端已经签过证书需要执行以下操作清空旧的证书,否则认证将失败

1.在服务端上执行以下命令其中“puppet2.hnr.com”为相关客户端主机

# puppet cert clean puppet2.hnr.com

2.在客户端上执行以下命令

# find /var/lib/puppet/ssl -name puppet2.hnr.com.pem -delete

三、puppet master服务端配置

1.允许所有hnr.com域的主机自动颁发证书

# vi /etc/puppet/autosign.conf

*.hnr.com

2.修改fileserver.conf

向该文件授予/etc/puppet/files目录的权限

# vi /etc/puppet/fileserver.conf

[files]

    path /etc/puppet/files

    allow *.hnr.com

四、puppet agent客户端配置

1.增加监听与指定服务端域名

# vi /etc/puppet/puppet.conf

[agent]

    listen = true  #监听8139端口

    server = puppet1.hnr.com

2.修改auth.conf

允许master发起kick命令,在path /之前增加

# vi /etc/puppet/auth.conf

path /run

method save

allow puppet1.hnr.com

 

五、启动服务端及客户端puppet程序

1.启动完后,在服务端上查看

puppet学习总结之证书自动认证_第1张图片

此时,证书已经自动认证完成

2.在客户端上执行以下命令

puppet学习总结之证书自动认证_第2张图片

此时,客户端与服务端通信正常