X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/388a527fdf388cd5383b978d0cb5406d787b8661..4ed87e86c638523d093bc97b32715c4c6a41a70d:/cookbooks/chef/templates/default/report.rb.erb?ds=sidebyside diff --git a/cookbooks/chef/templates/default/report.rb.erb b/cookbooks/chef/templates/default/report.rb.erb index 07a8753a8..4265d0660 100644 --- a/cookbooks/chef/templates/default/report.rb.erb +++ b/cookbooks/chef/templates/default/report.rb.erb @@ -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" -# 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 @@ -31,6 +31,10 @@ class Chef require "mail" + Mail.defaults do + delivery_method :exim, :location => "/usr/sbin/exim" + end + Mail.deliver do to to_address from from_address