From 19ac5d0a50ac64de8e781b9d31ce8ffc3f42000c Mon Sep 17 00:00:00 2001 From: Carl Crowder Date: Mon, 12 May 2014 12:10:09 +0200 Subject: [PATCH] [refs #75 akvo/akvo-rsr#541] Adding additional RSR configuration to (optionally) log errors to Sentry --- puppet/modules/rsr/manifests/config.pp | 5 +++++ puppet/modules/rsr/templates/local.conf.erb | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/puppet/modules/rsr/manifests/config.pp b/puppet/modules/rsr/manifests/config.pp index 1dd8b39..7bed91a 100644 --- a/puppet/modules/rsr/manifests/config.pp +++ b/puppet/modules/rsr/manifests/config.pp @@ -45,6 +45,11 @@ $statsd_prefix = "rsr.${::environment}" } + $use_sentry = hiera('rsr_use_sentry', false) + if $use_sentry { + $sentry_dsn = hiera('rsr_sentry_dsn') + } + $smtp_user = $rsr::params::smtp_user $smtp_password = $rsr::params::smtp_password diff --git a/puppet/modules/rsr/templates/local.conf.erb b/puppet/modules/rsr/templates/local.conf.erb index 149ed72..36da879 100644 --- a/puppet/modules/rsr/templates/local.conf.erb +++ b/puppet/modules/rsr/templates/local.conf.erb @@ -79,3 +79,16 @@ EMAIL_PORT = 465 EMAIL_HOST_USER = '<%= @smtp_user %>' EMAIL_HOST_PASSWORD = '<%= @smtp_password %>' EMAIL_USE_TLS = True + + +<% if @use_sentry %> +# Set your DSN value +RAVEN_CONFIG = { + 'dsn': '<%= @sentry_dsn %>', +} + +# Add raven to the list of installed apps +INSTALLED_APPS = INSTALLED_APPS + ( + 'raven.contrib.django.raven_compat', +) +<% -end %> \ No newline at end of file