大网数据广告活动
服务器运维问答

Generating and signing certificates in puppet version 5

· 52CE 我爱测

I am trying to install and configure puppet 5.3.2 on two identical Linux machines running Centos 7 (one being a master and the other being an agent). I have managed to install the puppet from the official repository on both and a…

问题原文

原帖链接 · hypersonics · CC BY-SA 3.0

I am trying to install and configure puppet 5.3.2 on two identical Linux machines running Centos 7 (one being a master and the other being an agent). I have managed to install the puppet from the official repository on both and added the following.

Master node in /etc/hosts

127.0.0.1                 <master hostname>
<master node ipaddress>   puppet, <master node hostname>
<agent node ipaddress>    <agent node hostname>

Agent node in /etc/hosts

127.0.0.1                 <agent hostname>
<master node ipaddress>   puppet, <master node hostname>
<agent node ipaddress>    <agent node hostname>

Master node in /etc/puppetlabs/puppet/puppet.conf

[master]
vardir = /opt/puppetlabs/server/data/puppetserver
logdir = /var/log/puppetlabs/puppetserver
rundir = /var/run/puppetlabs/puppetserver
pidfile = /var/run/puppetlabs/puppetserver/puppetserver.pid
codedir = /etc/puppetlabs/code
dns_alt_names = puppet, <master node hostname>
certname = puppet

Agent node in/etc/puppetlabs/puppet/puppet.conf

server = puppet, <master node hostname>

The puppet server starts successfully. However, I still need to generate and sign the appropriate certificates for both master and agent. For this firstly, I make sure the puppetserver is stopped on the puppet master node, and then on the puppet master node I issue:

sudo /opt/puppetlabs/bin/puppet cert list -a

I see a SHA256 certificate.

Now, I do not know how to proceed further. Any inputs would be highly appreciated.

已采纳解答

原帖链接 · hypersonics · CC BY-SA 3.0

I was able to get this working. Basically, when the puppet server is started initially, the certificate is generated and this can be viewed by

sudo /opt/puppetlabs/bin/puppet cert list -a

Next on the agent node, stop the puppet agent using the below if the agent is running (this can be found by systemctl status puppet

systemctl stop puppet

Create a certificate on the puppet agent which need to be signed by the puppet master. The certificate can be generated by:

/opt/puppetlabs/bin/puppet agent -t

On the master node, the agent certificate can be viewed by

/opt/puppetlabs/puppet cert list -a

The agent certificate should be signed now, for that

/opt/puppetlabs/puppet cert sign <puppet agent hostname>

Once the certificate is signed, this needs to be verified. However, before it is verified, the puppet agent should be up and running.

systemctl start puppet
systemctl enable puppet
/opt/puppetlabs/bin/puppet agent --fingerprint #certificate verification

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-10-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。