Faidon Liambotis has submitted this change and it was merged.

Change subject: sentry: use $::mail_smarthost for SMTP_HOST
......................................................................


sentry: use $::mail_smarthost for SMTP_HOST

Hardcoding the setting into the module is ugly but it's available
as a puppet variable and I couldn't figure out a way to reconcile
that with a hiera-based approach since hiera cannot interpolate
array elements.

Bug: T116709
Change-Id: If4b5e28d1c9cb270aa4d1aa866ead84f39c71cfc
---
M hieradata/labs/sentry/common.yaml
M hieradata/role/common/sentry.yaml
M modules/sentry/manifests/init.pp
M modules/sentry/templates/sentry.conf.py.erb
4 files changed, 1 insertion(+), 17 deletions(-)

Approvals:
  Faidon Liambotis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/hieradata/labs/sentry/common.yaml 
b/hieradata/labs/sentry/common.yaml
index da4100d..1476ddc 100644
--- a/hieradata/labs/sentry/common.yaml
+++ b/hieradata/labs/sentry/common.yaml
@@ -1,3 +1,2 @@
 sentry::server_name: "%{::sentry_server_name}"
-sentry::smtp_host: 'mx1001.wikimedia.org'
 sentry::admin_email: 'gti...@wikimedia.org'
diff --git a/hieradata/role/common/sentry.yaml 
b/hieradata/role/common/sentry.yaml
index a021f82..c07e1ed 100644
--- a/hieradata/role/common/sentry.yaml
+++ b/hieradata/role/common/sentry.yaml
@@ -1,3 +1,2 @@
 sentry::server_name: 'sentry.wikimedia.org'
-sentry::smtp_host: 'mx1001.wikimedia.org'
 sentry::admin_email: 'gti...@wikimedia.org'
diff --git a/modules/sentry/manifests/init.pp b/modules/sentry/manifests/init.pp
index 5f3b1e3..51ae189 100644
--- a/modules/sentry/manifests/init.pp
+++ b/modules/sentry/manifests/init.pp
@@ -11,15 +11,6 @@
 # [*server_name*]
 #   Domain name under which Sentry will be available.
 #
-# [*smtp_host*]
-#   SMTP server host name; used to send email alerts on new errors.
-#
-# [*smtp_user*]
-#   SMTP username.
-#
-# [*smtp_pass*]
-#   SMTP password.
-#
 # [*git_branch*]
 #   Which branch to check out.
 #
@@ -38,9 +29,6 @@
     $secret_key,
     $admin_pass,
     $admin_email = 'n...@wikimedia.org',
-    $smtp_host   = '',
-    $smtp_user   = '',
-    $smtp_pass   = '',
     $git_branch  = 'master',
 ) {
     include ::nginx
diff --git a/modules/sentry/templates/sentry.conf.py.erb 
b/modules/sentry/templates/sentry.conf.py.erb
index e17d8ab..5baa9e4 100644
--- a/modules/sentry/templates/sentry.conf.py.erb
+++ b/modules/sentry/templates/sentry.conf.py.erb
@@ -92,9 +92,7 @@
 #################
 
 EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
-EMAIL_HOST = '<%= @smtp_host %>'
-EMAIL_HOST_USER = '<%= @smtp_user %>'
-EMAIL_HOST_PASSWORD = '<%= @smtp_pass %>'
+EMAIL_HOST = '<%= @mail_smarthost[0] %>'
 SERVER_EMAIL = 'sentry@<%= @server_name %>'
 
 # see http://sentry.readthedocs.org/en/latest/beacon.html

-- 
To view, visit https://gerrit.wikimedia.org/r/250373
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If4b5e28d1c9cb270aa4d1aa866ead84f39c71cfc
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: BryanDavis <bda...@wikimedia.org>
Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to