工头与 Puppet 节点 Net::HTTPNotFound 错误
Foreman with Puppet node Net::HTTPNotFound Error
我已经按照官方文档在 RHEL 7.1 VM 上安装了 foreman (v1.9.0)。
我当前的环境包括:
- 1 x 人偶 master/foreman
- 2 个代理(RHEL 6.5 和 7)
Foreman 配置为将服务 9 个环境(包括生产环境)的 ENC。
已在工头中为 foreman/puppetmaster.
配置智能代理
代理在生成 CSR 并由人偶大师签名时没有任何问题。
当我 运行 远程机器上的 puppet 代理使用命令
puppet agent --no-daemonize --server <FQDN> --trace
我收到以下错误
Warning: Unable to fetch my node definition, but the agent will continue:
Warning: Error 400 on SERVER: Failed to find < agent FQDN> via exec: Execution of '/etc/puppet/node.rb < agent FQDN>' returned 1:
运行 puppet master 上引用的命令
sudo -u puppet /etc/puppet/node.rb <agent FQDN>
Returns错误:
Error retrieving node < agent FQDN> Net::HTTPNotFound
Check Foreman's /var/log/foreman/production.log for more information.
正在网上研究这个错误
“Foreman with puppet node.rb error 404 Not Found”
提供 puppet master 的标准响应不知道代理(DNS,/etc/hosts)。
在我的例子中,这不是问题,因为 运行ning 相同的 node.rb 命令针对 puppetmaster returns 相同的错误。一个简单的 ping 测试确认 DNS 设置正确。
虽然在 /var/log/httpd/foreman-ssl_access_ssl.log
中生成了 http 404 错误,但在 /var/log/foreman/production.log (inc debug) 中没有生成任何日志
< IP> - - [30/Sep/2015:15:13:29 +1000] GET /node/< agent FQDN>?format=yml HTTP/1.1" 404 48 "-" "Ruby"
node.rb 引用 foreman.yaml 相对于列出的条目是正确的我可以确认如下:
- :url:
- :ssl_ca:
- :ssl_cert:
- :ssl_key:
- 等等
这也是安装过程默认生成的文件,没有任何变化。
代理人是工头,但要实现这一点,一旦我配置了 puppet.conf 和 generated/signed 代理人证书,我 运行 命令
puppet agent -t <puppet master FQDN>
直到我手动 运行 命令
才将代理导入工头
foreman-rake puppet:import:hosts_and_facts
在工头中呼叫其中一位主持人,然后单击 'YAML' 显示每个代理的正确信息。
我什至使用 openssl 从证书中提取信息以确认它们是正确的。
更新:
我有 运行 命令
curl -k https://< Puppet Master FQDN>/foreman
这个returns输出
<html><body>You are being <a href="https://< Puppet Master FQDN>/foreman/users/login">redirected</a>.</body></html>
这会生成日志条目
~/foreman/production.log
2015-10-01 10:04:57 [app] [I]
|
| Starged GET "/foreman/" for < PUPPET MASTER IP> at 2015-10-01 10:04:57 +1000
2015-10-01 10:04:57 [app] [I] Processing by DashboardController#index as /
2015-10-01 10:04:57 [app] [I]Redirected to https://< PUPPET MASTER>/foreman/users/login
2015-10-01 10:04:57 [app] [I] Filter chain halted as :require_login
rendered or redirected
2015-10-01 10:04:57 [app] [I]Completed 302 Found in 7ms (Active Record: 0.6ms)
在 ~/httpd/foreman-ssl_access_ssl.log 中我得到这个
< PUPPET MASTER IP> - - [01/Oct/2015:10:05:26 +1000] "GET /foreman/ HTTP/1.1" 302 129 "-" "curl/7.29.0"
同一日志中的其他相关日志条目将是
< PUPPET MASTER IP> - - [01/Oct/2015:09:53:28 +1000] "POST /api/hosts/facts /HTTP/1.1" 404 27 "-" "Ruby"
< PUPPET MASTER IP> - - [01/Oct/2015:09:53:28 +1000] "GET /node/< PUPPET MASTER>?format=yml HTTP/1.1" 404 52 "-" "Ruby"
所以要问的问题是我可以对 Puppet/Foreman HTTP 配置做些什么来解决 404 错误
看起来 ENC 脚本在 Web 服务器的根目录 (/api) 请求路径,而 Foreman 本身托管在子 URI (/foreman/)。它应该命中 /foreman/api/hosts/facts
、/foreman/node/
等,这就是 Apache 返回 404,但 Foreman 没有看到和记录请求的原因。
您可以通过 :url:
设置更改 node.rb 在 /etc/puppet/foreman.yaml 中使用的 URL。在此处添加 /foreman
后缀。
或者,如果您使用了 Foreman 安装程序,那么您可以使用 --puppet-server-foreman-url=https://example.com/foreman
重新运行 它,这应该做同样的事情。
我已经按照官方文档在 RHEL 7.1 VM 上安装了 foreman (v1.9.0)。
我当前的环境包括:
- 1 x 人偶 master/foreman
- 2 个代理(RHEL 6.5 和 7)
Foreman 配置为将服务 9 个环境(包括生产环境)的 ENC。 已在工头中为 foreman/puppetmaster.
配置智能代理代理在生成 CSR 并由人偶大师签名时没有任何问题。
当我 运行 远程机器上的 puppet 代理使用命令
puppet agent --no-daemonize --server <FQDN> --trace
我收到以下错误
Warning: Unable to fetch my node definition, but the agent will continue:
Warning: Error 400 on SERVER: Failed to find < agent FQDN> via exec: Execution of '/etc/puppet/node.rb < agent FQDN>' returned 1:
运行 puppet master 上引用的命令
sudo -u puppet /etc/puppet/node.rb <agent FQDN>
Returns错误:
Error retrieving node < agent FQDN> Net::HTTPNotFound
Check Foreman's /var/log/foreman/production.log for more information.
正在网上研究这个错误 “Foreman with puppet node.rb error 404 Not Found” 提供 puppet master 的标准响应不知道代理(DNS,/etc/hosts)。 在我的例子中,这不是问题,因为 运行ning 相同的 node.rb 命令针对 puppetmaster returns 相同的错误。一个简单的 ping 测试确认 DNS 设置正确。
虽然在 /var/log/httpd/foreman-ssl_access_ssl.log
中生成了 http 404 错误,但在 /var/log/foreman/production.log (inc debug) 中没有生成任何日志< IP> - - [30/Sep/2015:15:13:29 +1000] GET /node/< agent FQDN>?format=yml HTTP/1.1" 404 48 "-" "Ruby"
node.rb 引用 foreman.yaml 相对于列出的条目是正确的我可以确认如下:
- :url:
- :ssl_ca:
- :ssl_cert:
- :ssl_key:
- 等等
这也是安装过程默认生成的文件,没有任何变化。
代理人是工头,但要实现这一点,一旦我配置了 puppet.conf 和 generated/signed 代理人证书,我 运行 命令
puppet agent -t <puppet master FQDN>
直到我手动 运行 命令
才将代理导入工头foreman-rake puppet:import:hosts_and_facts
在工头中呼叫其中一位主持人,然后单击 'YAML' 显示每个代理的正确信息。
我什至使用 openssl 从证书中提取信息以确认它们是正确的。
更新:
我有 运行 命令
curl -k https://< Puppet Master FQDN>/foreman
这个returns输出
<html><body>You are being <a href="https://< Puppet Master FQDN>/foreman/users/login">redirected</a>.</body></html>
这会生成日志条目 ~/foreman/production.log
2015-10-01 10:04:57 [app] [I] | | Starged GET "/foreman/" for < PUPPET MASTER IP> at 2015-10-01 10:04:57 +1000 2015-10-01 10:04:57 [app] [I] Processing by DashboardController#index as / 2015-10-01 10:04:57 [app] [I]Redirected to https://< PUPPET MASTER>/foreman/users/login 2015-10-01 10:04:57 [app] [I] Filter chain halted as :require_login rendered or redirected 2015-10-01 10:04:57 [app] [I]Completed 302 Found in 7ms (Active Record: 0.6ms)
在 ~/httpd/foreman-ssl_access_ssl.log 中我得到这个
< PUPPET MASTER IP> - - [01/Oct/2015:10:05:26 +1000] "GET /foreman/ HTTP/1.1" 302 129 "-" "curl/7.29.0"
同一日志中的其他相关日志条目将是
< PUPPET MASTER IP> - - [01/Oct/2015:09:53:28 +1000] "POST /api/hosts/facts /HTTP/1.1" 404 27 "-" "Ruby"
< PUPPET MASTER IP> - - [01/Oct/2015:09:53:28 +1000] "GET /node/< PUPPET MASTER>?format=yml HTTP/1.1" 404 52 "-" "Ruby"
所以要问的问题是我可以对 Puppet/Foreman HTTP 配置做些什么来解决 404 错误
看起来 ENC 脚本在 Web 服务器的根目录 (/api) 请求路径,而 Foreman 本身托管在子 URI (/foreman/)。它应该命中 /foreman/api/hosts/facts
、/foreman/node/
等,这就是 Apache 返回 404,但 Foreman 没有看到和记录请求的原因。
您可以通过 :url:
设置更改 node.rb 在 /etc/puppet/foreman.yaml 中使用的 URL。在此处添加 /foreman
后缀。
或者,如果您使用了 Foreman 安装程序,那么您可以使用 --puppet-server-foreman-url=https://example.com/foreman
重新运行 它,这应该做同样的事情。