Dzahn has submitted this change and it was merged.

Change subject: phabricator: only run dumps on active server
......................................................................


phabricator: only run dumps on active server

Disable dumps, cron and rsync, on the inactive phabricator
server until further notice, to avoid cronspam.

Change-Id: Id13adf92cab1934664a9e134e12d6b134ca52fdc
---
M modules/role/manifests/phabricator/main.pp
1 file changed, 16 insertions(+), 13 deletions(-)

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



diff --git a/modules/role/manifests/phabricator/main.pp 
b/modules/role/manifests/phabricator/main.pp
index 0cfa45c..44d699a 100644
--- a/modules/role/manifests/phabricator/main.pp
+++ b/modules/role/manifests/phabricator/main.pp
@@ -26,6 +26,18 @@
     $phab_root_dir = '/srv/phab'
     $deploy_target = 'phabricator/deployment'
 
+    # logmail and dumps are only enabled on the active server set in Hiera
+    $phabricator_active_server = hiera('phabricator_active_server')
+    if $::hostname == $phabricator_active_server {
+        $logmail_ensure = 'present'
+        $dump_rsync_ensure = 'present'
+        $dump_enabled = true
+    } else {
+        $logmail_ensure = 'absent'
+        $dump_rsync_ensure ='absent'
+        $dump_enabled = false
+    }
+
     # lint:ignore:arrow_alignment
     class { '::phabricator':
         deploy_target    => $deploy_target,
@@ -90,12 +102,12 @@
         phabtools_cert  => $role::phabricator::config::phabtools_cert,
         phabtools_user  => $role::phabricator::config::phabtools_user,
         gerritbot_token => $role::phabricator::config::gerritbot_token,
-        dump            => true,
+        dump            => $dump_enabled,
         require         => Package[$deploy_target]
     }
 
     cron { 'phab_dump':
-        ensure  => present,
+        ensure  => $dump_rsync_ensure,
         command => 'rsync -zpt --bwlimit=40000 -4 
/srv/dumps/phabricator_public.dump dataset1001.wikimedia.org::other_misc/ 
>/dev/null 2>&1',
         user    => 'root',
         minute  => '10',
@@ -186,17 +198,8 @@
 
     # community metrics mail (T81784, T1003)
     # disabled due to maintenance: T138460, re-enabled T139950
-
-    # crons are only enabled on the active server set in Hiera
-    $phabricator_active_server = hiera('phabricator_active_server')
-    if $::hostname == $phabricator_active_server {
-        $phab_logmail_ensure = 'present'
-    } else {
-        $phab_logmail_ensure = 'absent'
-    }
-
     phabricator::logmail {'communitymetrics':
-        ensure       => $phab_logmail_ensure,
+        ensure       => $logmail_ensure,
         script_name  => 'community_metrics.sh',
         rcpt_address => '[email protected]',
         sndr_address => '[email protected]',
@@ -207,7 +210,7 @@
     # project changes mail (T85183)
     # disabled due to maintenance: T138460, re-enabled T139950
     phabricator::logmail {'projectchanges':
-        ensure       => $phab_logmail_ensure,
+        ensure       => $logmail_ensure,
         script_name  => 'project_changes.sh',
         rcpt_address => [ '[email protected]' ],
         sndr_address => '[email protected]',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id13adf92cab1934664a9e134e12d6b134ca52fdc
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: 20after4 <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to