设置 puppetmaster:主机名与服务器证书不匹配

设置 puppetmaster:主机名与服务器证书不匹配

我是 Puppet 和 Puppetmaster 的新手...我们之前已经设置了 Puppets,现在又有了新的 Puppetmaster...


第三次编辑

删除主服务器(ghive-ldap)和客户端(giab10)上的 ssl 文件后

主主机的主机名是ghive-ldap,并且在客户端的主机名中我有这个。

在 master 上:

puppet cert clean ghive-ldap
puppet cert generate --dns_alt_names ghive-ldap ghive-ldap


sudo puppetca --sign giab10
err: Could not call sign: Could not find certificate request for giab10

那么在客户端上:

sudo puppet cert --generate giab10
notice: giab10 has a waiting certificate request
notice: Signed certificate request for giab10
notice: Removing file Puppet::SSL::CertificateRequest giab10 at '/var/lib/puppet/ssl/ca/requests/giab10.pem'
notice: Removing file Puppet::SSL::CertificateRequest giab10 at '/var/lib/puppet/ssl/certificate_requests/giab10.pem'
giabadmin@giab10:~$ sudo puppet cert --list --all
+ giab10 (0F:CB:............)

我在客户端上运行了这个

sudo puppetd --test --debug
.....
err: Could not retrieve catalog from remote server: getaddrinfo: Name or service not know

好的...让我在客户端上试试

sudo puppet agent --server ghive-ldap --waitforcert 60 --test --verbose
err: Could not retrieve catalog from remote server: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

嘎嘎.....我删除了 ssl 文件,但还是没用!!一定是出了什么问题...

我该如何从头开始?文档没有给我太多帮助...抱歉我是菜鸟。谢谢

PS:另外,如何确保两台服务器的时间同步?

答案1

puppetmaster 为哪个主机名生成了证书?puppet 客户端希望证书对“puppetmaster”有效,但似乎不是为这个主机名颁发的。我认为“puppet”可能是 puppetmaster 上的默认 CN,或者是服务器的主机名。您可以通过在服务器的证书上运行“openssl x509 -text -in cert.pem”来检查它,或者https://yourpuppetmaster:8140/使用浏览器连接到,并查看证书的 CN 和 dns_alt_names 中包含哪些域。


编辑

您只有“master”的证书,但您的客户端连接到“puppetmaster”。因此,要么客户端需要期望“master”,要么您需要在主服务器上获得“puppetmaster”的证书。puppet.conf 中 [master] 块中的“certname=puppetmaster”将更改服务器上的 CN(http://docs.puppetlabs.com/references/stable/configuration.html#certname)。您可能需要删除旧证书,但我对此不太确定。或者,您可以让客户端连接到“master”,方法是将其添加到 /etc/hosts 或您的 DNS 区域(如果您正在运行 DNS 区域)。

相关内容