Skip to content

Instantly share code, notes, and snippets.

@maplebed
Last active November 7, 2017 23:42
Show Gist options
  • Save maplebed/d4fb6aa057a681d24d5bc875220358c0 to your computer and use it in GitHub Desktop.
Save maplebed/d4fb6aa057a681d24d5bc875220358c0 to your computer and use it in GitHub Desktop.
wk = node[:honeycomb][:writekey]
n = node
Chef.event_handler do
Chef::Client.when_run_completes_successfully {|run_status| @handler.instance_variable_set(:@run_status, run_status) }
Chef::Client.when_run_fails {|run_status| @handler.instance_variable_set(:@run_status, run_status) }
::Honeycomb.init(wk)
on :run_completed do
puts "run_completed handler"
::Honeycomb.report(n, @run_status)
end
on :run_failed do
puts "run_failed handler"
::Honeycomb.report(n, @run_status)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment