Hello All,
I'm trying to start using external nodes under foreman, and I'm
running into some issues. I have the entries in puppet.conf:
[main]
external_nodes = /etc/puppet/external_node.rb
node_terminus = exec
The enternal_node.rb script is the one that came with foreman:
#!/usr/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="https://hostname: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]
end
##########################################################################
When I run it against a node, which I already took off the internal
node definitions, I get the following error:
/etc/puppet/external_node.rb hostname
/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
I went over the documentation meticulously before posting, but
obviously I'm still missing something. Can anyone shed some light on
this?
Thanks,
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.