theforeman - Foreman with Puppet node Net::HTTPNotFound Error -


i have installed foreman (v1.9.0) on rhel 7.1 vm per official documentation.

my current environment consists of:

  • 1 x puppet master/foreman
  • 2 x agents (rhel 6.5 & 7)

foreman configured enc service 9 environments (inc production). smart proxy has been configured in foreman foreman/puppetmaster.

there no issues on agents in generating csr , getting signed puppet master.

when run puppet agent on remote machine command

puppet agent --no-daemonize --server <fqdn> --trace 

i following errors

warning: unable fetch node definition, agent continue:

warning: error 400 on server: failed find < agent fqdn> via exec: execution of '/etc/puppet/node.rb < agent fqdn>' returned 1:

running referenced command on puppet master

sudo -u puppet /etc/puppet/node.rb <agent fqdn>  

returns error:

error retrieving node < agent fqdn> net::httpnotfound

check foreman's /var/log/foreman/production.log more information.

researching error on web "foreman puppet node.rb error 404 not found" provides standard response of puppet master not aware (dns, /etc/hosts) of agent. in case not issue running same node.rb command against puppetmaster returns same error. simple ping test confirms dns correctly setup.

there no logs generated in /var/log/foreman/production.log (inc debug) when fails, although there http 404 error generated in /var/log/httpd/foreman-ssl_access_ssl.log

< ip> - - [30/sep/2015:15:13:29 +1000] /node/< agent fqdn>?format=yml http/1.1" 404 48 "-" "ruby"

node.rb references foreman.yaml correct in relation listed entries can confirm like:

  • :url:
  • :ssl_ca:
  • :ssl_cert:
  • :ssl_key:
  • etc

it default file generated install process no changes.

the agents in foreman, achieve once configured puppet.conf , generated/signed agent certs ran command

puppet agent -t <puppet master fqdn> 

the agents not imported foreman until manually ran command

foreman-rake puppet:import:hosts_and_facts 

calling 1 of hosts in foreman , clicking on 'yaml' shows correct information each agent.

i have pulled information out of certificates using openssl confirm correct.

update:

i have run command

curl -k https://< puppet master fqdn>/foreman

this returns output

<html><body>you being <a href="https://< puppet master fqdn>/foreman/users/login">redirected</a>.</body></html> 

this generates log entry in ~/foreman/production.log

2015-10-01 10:04:57 [app] [i] | | starged "/foreman/" < puppet master ip> @ 2015-10-01 10:04:57 +1000 2015-10-01 10:04:57 [app] [i] processing dashboardcontroller#index / 2015-10-01 10:04:57 [app] [i]redirected https://< puppet master>/foreman/users/login 2015-10-01 10:04:57 [app] [i] filter chain halted :require_login rendered or redirected 2015-10-01 10:04:57 [app] [i]completed 302 found in 7ms (active record: 0.6ms)

while in ~/httpd/foreman-ssl_access_ssl.log this

< puppet master ip> - - [01/oct/2015:10:05:26 +1000] "get /foreman/ http/1.1" 302 129 "-" "curl/7.29.0"

other relevant log entries in same log be

< 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"

so question ask can puppet/foreman http config resolve 404 errors

it looks enc script requesting paths @ root of web server (/api) while foreman hosted @ sub-uri (/foreman/). should hitting /foreman/api/hosts/facts, /foreman/node/ etc, why apache's returning 404, foreman isn't seeing , logging request.

you can change url node.rb uses in /etc/puppet/foreman.yaml, via :url: setting. add /foreman suffix here.

alternatively if used foreman installer re-run --puppet-server-foreman-url=https://example.com/foreman should same thing.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -