Encoding.default_external = Encoding::UTF_8
+# Accept the license
+
+chef_license "accept"
+
# Log at level info
log_level :info
log_location "/var/log/chef/client.log"
+# Set the node name
+
+node_name "<%= node.name %>"
+
# Verify SSL certificates
ssl_verify_mode :verify_peer
# Set the URL for the chef server
-chef_server_url "https://chef.openstreetmap.org"
-
-# Make our plugins visible to ohai
-
-Ohai::Config[:plugin_path] << "<%= node[:ohai][:plugin_dir] %>"
-
-begin
-
- # Load supporting code for report handlers
+chef_server_url "https://chef.openstreetmap.org/organizations/openstreetmap"
- require "/etc/chef/report"
+# Enable some optional ohai plugins
- # Create report handler
+ohai.optional_plugins = %w[Passwd]
- email_handler = Chef::Handler::Email.new(:to => "tom@compton.nu")
+# Load supporting code for report handlers
- # Configure report handlers
+require "/etc/chef/report"
- exception_handlers << email_handler
- report_handlers << email_handler
+# Create report handler
-rescue
+email_handler = Chef::Handler::Email.new(:to => ["tom@compton.nu", "openstreetmap@firefishy.com"])
- # Ignore errors in case required gems not installed yet
+# Configure report handlers
-end
+exception_handlers.delete_if { |h| h.is_a?(Chef::Handler::Email) } << email_handler
+report_handlers.delete_if { |h| h.is_a?(Chef::Handler::Email) } << email_handler