Sha256: c9037d0ca0bcb252a618826e85442916520c92e40dab37abfbb73eeae5762b7b
Contents?: true
Size: 580 Bytes
Versions: 38
Compression:
Stored size: 580 Bytes
Contents
require 'puppet' require 'net/http' require 'uri' Puppet::Reports.register_report(:http) do desc <<-DESC Send report information via HTTP to the `reporturl`. Each host sends its report as a YAML dump and this sends this YAML to a client via HTTP POST. The YAML is the `report` parameter of the request." DESC def process url = URI.parse(Puppet[:reporturl]) req = Net::HTTP::Post.new(url.path) req.body = self.to_yaml req.content_type = "application/x-yaml" Net::HTTP.new(url.host, url.port).start {|http| http.request(req) } end end
Version data entries
38 entries across 38 versions & 2 rubygems