我尝试在 Ubuntu 14.04 服务器上安装 Foreman 多次。Foreman 1.5 和 1.6 总是同时失败并出现以下错误:
/usr/bin/puppet cert --generate ubuntutest.domain.com returned 23 instead of one of [0]
/Stage[main]/Puppet::Server::Config/Exec[puppet_server_config-generate_ca_cert] /returns: change from notrun to 0 failed: /usr/bin/puppet cert --generate ubuntutest.domain.com returned 23 instead of one of [0]
/Stage[main]/Puppet::Server::Config/Exec[puppet_server_config-generate_ca_cert]: Failed to call refresh: /usr/bin/puppet cert --generate ubuntutest.domain.com returned 23 instead of one of [0]
/Stage[main]/Puppet::Server::Config/Exec[puppet_server_config-generate_ca_cert]: /usr/bin/puppet cert --generate ubuntutest.domain.com returned 23 instead of one of [0]
/Stage[main]/Apache::Service/Service[httpd]: Failed to call refresh: Could not start Service[httpd]: Execution of '/etc/init.d/apache2 start' returned 1:
/Stage[main]/Apache::Service/Service[httpd]: Could not start Service[httpd]: Execution of '/etc/init.d/apache2 start' returned 1:
Installing Done [100%] [...............................................................................]
Something went wrong! Check the log for ERROR-level output
在我手动生成证书之后,apache 启动成功,并且可以访问 foreman 网络界面。
我按照领班的指示做了puppet agent --test
以下尝试:
Info: Caching certificate_revocation_list for ca
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: Error 400 on SERVER: Failed to find ubuntutest.infraserv.com via exec: Execution of '/etc/puppet/node.rb ubuntutest.infraserv.com' returned 1:
Info: Retrieving plugin
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node ubuntutest.infraserv.com: Failed to find ubuntutest.infraserv.com via exec: Execution of '/etc/puppet/node.rb ubuntutest.infraserv.com' returned 1:
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
.... :(
答案1
对于非 Puppetmaster 的 Foreman 专用主机,请清除 Foreman 主机上 Puppet 的整个 SSL 目录并完全重新生成证书。
还要确保您的 /etc/hosts 文件具有正确格式的主机记录。旧版 Foreman 安装过去经常抱怨这一点,但这并不会造成影响。如果您需要在环境中使用 DHCP,我绝对支持无限租约长度和固定 Foreman 预留。
10.0.0.2 foreman1.production.example.com foreman1
一旦完成,这个特定的错误就应该得到解决。