External Node Classifier -- Apache/Passenger/Foreman

It looks like the culprit is the external node classifier: This
is the error from the server:

err: Could not find node 'client.dev.domain.com'; cannot compile
err: Failed to find client.dev.domain.com via exec: Execution of '/
etc/
puppet/external_node.rb client.dev.domain.com' returned 1: /usr/lib/
ruby/1.8/net/http.rb:2022:in read_status_line': wrong status line: "<! DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN \">" (Net::HTTPBadResponse) from /usr/lib/ruby/1.8/net/http.rb:2009:inread_new'
from /usr/lib/ruby/1.8/net/http.rb:1050:in request' from /etc/puppet/external_node.rb:14 from /usr/lib/ruby/1.8/net/http.rb:543:instart'
from /usr/lib/ruby/1.8/net/http.rb:440:in `start'
from /etc/puppet/external_node.rb:13
err: Could not find node 'client.dev.domain.com'; cannot compile
This is the Node Classifier:
#!/bin/ruby

a simple script which fetches external nodes from Foreman

you can basically use anything that knows how to get http data,

e.g.
wget/curl etc.

Foreman url

foreman_url="http://server:443"
require 'net/http'
foreman_url += "/node/#{ARGV[0]}?format=yml"
url = URI.parse(foreman_url)
req = Net::HTTP::Get.new(foreman_url)
res = Net::HTTP.start(url.host, url.port) { |http|
http.request(req)
}

case res
when Net::HTTPOK
puts res.body
else
$stderr.puts "Error retrieving node %s: %s" % [ARGV[0], res.class]

What node classifier do you guys use with Apache/Passenger config?
Thanks,

Hi,

It looks like an error with your ssl setup, make sure that your external
node script returns the right value. try first without ssl and move on :slight_smile:

Ohad

··· On Wed, Jul 28, 2010 at 1:51 AM, CraftyTech wrote:

It looks like the culprit is the external node classifier: This
is the error from the server:

err: Could not find node ‘client.dev.domain.com’; cannot compile
err: Failed to find client.dev.domain.com via exec: Execution of ‘/
etc/
puppet/external_node.rb client.dev.domain.com’ returned 1: /usr/lib/
ruby/1.8/net/http.rb:2022:in read_status_line': wrong status line: "<! DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN \">" (Net::HTTPBadResponse) from /usr/lib/ruby/1.8/net/http.rb:2009:inread_new’
from /usr/lib/ruby/1.8/net/http.rb:1050:in request' from /etc/puppet/external_node.rb:14 from /usr/lib/ruby/1.8/net/http.rb:543:instart’
from /usr/lib/ruby/1.8/net/http.rb:440:in `start’
from /etc/puppet/external_node.rb:13
err: Could not find node ‘client.dev.domain.com’; cannot compile
This is the Node Classifier:
#!/bin/ruby

a simple script which fetches external nodes from Foreman

you can basically use anything that knows how to get http data,

e.g.
wget/curl etc.

Foreman url

foreman_url="http://server:443"
require 'net/http’
foreman_url += "/node/#{ARGV[0]}?format=yml"
url = URI.parse(foreman_url)
req = Net::HTTP::Get.new(foreman_url)
res = Net::HTTP.start(url.host, url.port) { |http|
http.request(req)
}

case res
when Net::HTTPOK
puts res.body
else
$stderr.puts “Error retrieving node %s: %s” % [ARGV[0], res.class]

What node classifier do you guys use with Apache/Passenger config?
Thanks,


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To post to this group, send email to foreman-users@googlegroups.com.
To unsubscribe from this group, send email to
foreman-users+unsubscribe@googlegroups.comforeman-users%2Bunsubscribe@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.

Thanks for all your Help Ohad. I configured the two vhosts (http/
https) and everything works fine.

Cheers,

··· On Jul 28, 8:25 am, Ohad Levy wrote: > Hi, > > It looks like an error with your ssl setup, make sure that your external > node script returns the right value. try first without ssl and move on :) > > Ohad > > > > On Wed, Jul 28, 2010 at 1:51 AM, CraftyTech wrote: > > It looks like the culprit is the external node classifier: This > > is the error from the server: > > > err: Could not find node 'client.dev.domain.com'; cannot compile > > err: Failed to find client.dev.domain.com via exec: Execution of '/ > > etc/ > > puppet/external_node.rb client.dev.domain.com' returned 1: /usr/lib/ > > ruby/1.8/net/http.rb:2022:in `read_status_line': wrong status line: > > " > DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN > > \">" (Net::HTTPBadResponse) > > from /usr/lib/ruby/1.8/net/http.rb:2009:in `read_new' > > from /usr/lib/ruby/1.8/net/http.rb:1050:in `request' > > from /etc/puppet/external_node.rb:14 > > from /usr/lib/ruby/1.8/net/http.rb:543:in `start' > > from /usr/lib/ruby/1.8/net/http.rb:440:in `start' > > from /etc/puppet/external_node.rb:13 > > err: Could not find node 'client.dev.domain.com'; cannot compile > > This is the Node Classifier: > > #!/bin/ruby > > # a simple script which fetches external nodes from Foreman > > # you can basically use anything that knows how to get http data, > > e.g. > > wget/curl etc. > > # Foreman url > > foreman_url="http://server:443" > > require 'net/http' > > foreman_url += "/node/#{ARGV[0]}?format=yml" > > url = URI.parse(foreman_url) > > req = Net::HTTP::Get.new(foreman_url) > > res = Net::HTTP.start(url.host, url.port) { |http| > > http.request(req) > > } > > > case res > > when Net::HTTPOK > > puts res.body > > else > > $stderr.puts "Error retrieving node %s: %s" % [ARGV[0], res.class] > > > What node classifier do you guys use with Apache/Passenger config? > > Thanks, > > > -- > > You received this message because you are subscribed to the Google Groups > > "Foreman users" group. > > To post to this group, send email to foreman-users@googlegroups.com. > > To unsubscribe from this group, send email to > > foreman-users+unsubscribe@googlegroups.com > > . > > For more options, visit this group at > >http://groups.google.com/group/foreman-users?hl=en.