Enable chef report handler
authorTom Hughes <tom@compton.nu>
Wed, 25 Jul 2018 07:40:02 +0000 (08:40 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 25 Jul 2018 08:36:42 +0000 (09:36 +0100)
cookbooks/chef/templates/default/client.rb.erb
cookbooks/chef/templates/default/report.rb.erb

index 5c9d888f581c7548a22e7a1f6e82d376a318df13..6b72349556c041abb7d073e6f76ccebacc0cfdb1 100644 (file)
@@ -39,5 +39,4 @@ email_handler = Chef::Handler::Email.new(:to => ["tom@compton.nu", "openstreetma
 
 # Configure report handlers
 
 
 # Configure report handlers
 
-#exception_handlers << email_handler
-#report_handlers << email_handler
+report_handlers << email_handler
index 07a8753a8a4b4ed0bc0366f6111bf754d8e9d0fd..20e32ef4fccea228512250a50e68e2aaaf29e1a8 100644 (file)
@@ -20,9 +20,9 @@ class Chef
         if failed? && !exception.is_a?(SystemExit)
           message_subject = "Chef run failed on #{node.name}"
           message_body = "#{run_status.formatted_exception}\n"
         if failed? && !exception.is_a?(SystemExit)
           message_subject = "Chef run failed on #{node.name}"
           message_body = "#{run_status.formatted_exception}\n"
-#        elsif elapsed_time > 600
-#          message_subject = "Chef run took #{elapsed_time} on #{node.name}"
-#          message_body = ""
+        elsif elapsed_time > 600
+          message_subject = "Chef run took #{elapsed_time} on #{node.name}"
+          message_body = ""
         end
 
         return unless message_subject
         end
 
         return unless message_subject