生产环境中的三台机器存在一些硬件问题,已经退役。基础架构团队已重新安装它们,并为它们提供了相同的主机名和IP地址。目的是在这些系统上运行Puppet,以便可以再次调试它们。
尝试
1)通过发出以下命令,从Puppetmaster中删除了旧的Puppet证书:
puppet cert revoke grb16.company.com
puppet cert clean grb16.company.com
2)删除旧证书后,通过从重新安装的节点之一发出以下命令来创建新的证书请求:
[root@grb16 ~]# puppet agent -t
Info: csr_attributes file loading from /etc/puppet/csr_attributes.yaml
Info: Creating a new SSL certificate request for grb16.company.com
Info: Certificate Request fingerprint (SHA256): 6F:2D:1D:71:67:18:99:86:2C:22:A1:14:80:55:34:35:FD:20:88:1F:36:ED:A7:7B:2A:12:09:4D:F8:EC:BF:6D
Exiting; no certificate found and waitforcert is disabled
[root@grb16 ~]#
3)一旦证书请求在Puppetmaster上可见,就会发出以下命令来对证书请求进行签名:
[root@foreman ~]# puppet cert sign grb16.company.com
Notice: Signed certificate request for grb16.company.com
Notice: Removing file Puppet::SSL::CertificateRequest grb16.company.com at '/var/lib/puppet/ssl/ca/requests/grb16.company.com.pem'
[root@foreman ~]#
问题
签署证书申请并启动木偶运行后,将引发以下错误:
[root@grb16 ~]# puppet agent -t
Info: Caching certificate for grb16.company.com
Error: Could not request certificate: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Exiting; failed to retrieve certificate and waitforcert is disabled
[root@grb16 ~]#
第二次运行Puppet将导致:
[root@grb16 ~]# puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Info: Retrieving pluginfacts
Error: /File[/var/lib/puppet/facts.d]: Failed to generate additional resources using 'eval_generate': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Error: /File[/var/lib/puppet/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet://foreman.company.com/pluginfacts: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Wrapped exception:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Info: Retrieving plugin
Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Error: /File[/var/lib/puppet/lib]: Could not evaluate: Could not retrieve file metadata for puppet://foreman.company.com/plugins: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Wrapped exception:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Error: Could not retrieve catalog from remote server: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
Error: Could not send report: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed: [CRL is not yet valid for /CN=Puppet CA: foreman.company.com]
[root@grb16 ~]#
分析
为了解决该问题,对错误消息进行了调查,看起来该问题与SSL或Puppet有关。这些软件包之一可能安装不正确,或者在重新安装的节点上安装了错误的版本。
木偶
[root@grb16 ~]# yum list installed |grep puppet
facter.x86_64 1:2.3.0-1.el6 @puppetlabs_6_products
hiera.noarch 1.3.4-1.el6 @puppetlabs_6_products
puppet.noarch 3.7.3-1.el6 @puppetlabs_6_products
puppetlabs-release.noarch
6-11 @puppetlabs_6_products
ruby-augeas.x86_64 0.4.1-3.el6 @puppetlabs_6_deps
ruby-shadow.x86_64 1:2.2.0-2.el6 @puppetlabs_6_deps
rubygem-json.x86_64 1.5.5-3.el6 @puppetlabs_6_deps
SSL协议
[root@grb16 ~]# yum list installed |grep ssl
nss_compat_ossl.x86_64 0.9.6-1.el6 @anaconda-CentOS-201410241409.x86_64/6.6
openssl.x86_64 1.0.1e-30.el6_6.4
openssl-devel.x86_64 1.0.1e-30.el6_6.4
[root@grb16 ~]#
在各种服务器上安装的SSL和Puppet程序包之间未发现差异。尚未停用或重新安装的系统仍可以运行Puppet。该问题仅限于重新安装的服务器。请注意,Puppet尚未在其他两台重新安装的服务器上运行。是什么导致此问题以及如何解决?
puppet agent -t
我在客户端上运行的第一个证书上,它会创建证书并将其发送给puppetmaster进行批准,因此,如果这是颁发新证书的正确方法,那么我会这样做。