Sha256: 6fd1a41f62d915a76aaa80432289633f5c14ef1ec2d356f16332a538c3270fee

Contents?: true

Size: 519 Bytes

Versions: 3

Compression:

Stored size: 519 Bytes

Contents

require "net/http"
require 'chef/handler'
module Isbumiawake
  module Chef
    class Handler < ::Chef::Handler

      def initialize(args)
        @url = args[:url]
      end

      def report
        Net::HTTP.post_form(self.url, :message => self.message).body
      end

      def url
        URI.parse(@url)
      end

      def message
        "Chef run on node #{node.fqdn} #{status} completed in #{elapsed_time} (#{start_time}-#{end_time}) and updated: #{updated_resources.join(",")}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
isbumiawake-chef-0.1.2 lib/isbumiawake/chef/handler.rb
isbumiawake-chef-0.1.1 lib/isbumiawake/chef/handler.rb
isbumiawake-chef-0.1.0 lib/isbumiawake/chef/handler.rb