Refactor #1112
closedENC - Self signed certificates
Description
suggested modifications for extras/puppet/foreman/files/external_node.rb
--- external_node.rb 2011-08-03 09:52:34.287126938 -0700
++ new_external_node.rb 2011-08-15 08:55:50.591256868 -0700@ -62,9 +62,18
@
def enc
foreman_url = "#{url}/node/#{certname}?format=yml"
uri = URI.parse(foreman_url)
+ # comment the next 2 lines if you need to use self-signed certificates
req = Net::HTTP::Get.new(foreman_url)
res = Net::HTTP.start(uri.host, uri.port) { |http| http.request(req) }
+ # uncomment the next 5 lines if you need to use self-signed certificate
+ # https = Net::HTTP.new(uri.host, uri.port)
+ # https.use_ssl = true
+ # https.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ # req = Net::HTTP::Get.new(foreman_url)
+ # res = https.request(req)
+
raise "Error retrieving node #{certname}: #{res.class}" unless res.code == "200"
res.body
end
Updated by Ohad Levy over 13 years ago
any chance you want to send it as a git patch or github pull request?
thanks!
Updated by Craig White over 13 years ago
If I knew how...
- cd /var/www/foreman/
- git format-patch origin/develop --stdout #
- git status extras/puppet/foreman/files/*
- On branch develop
- Your branch is behind 'origin/develop' by 43 commits, and can be fast-forwarded.
#
nothing to commit (working directory clean)
Updated by Benjamin Papillon over 11 years ago
- Status changed from New to Closed
The script has been refactored to node.rb taking into account the PuppetCA certificates.
Feel free to reopen the ticket if it is not matching your needs.