Hello Ottomata,

I'd like you to do a code review.  Please visit

    https://gerrit.wikimedia.org/r/186253

to review the following change.

Change subject: For stats user's cron jobs on stat1002, make empty MAILTO 
explicit
......................................................................

For stats user's cron jobs on stat1002, make empty MAILTO explicit

The cron jobs of the stats user on stat1002 came without a MAILTO
setting, hence MAILTO was implicitly empty.

As we will add a cron job with MAILTO in a follow-up commit, and
puppet does not limit MAILTO to the cron job where it is specified, we
need to explicitly set MAILTO to the empty string for the current jobs
to avoid them picking up the MAILTO of the upcoming job.

Change-Id: Iff1961cf1a617aa2be043a5458a1eefbab04c258
---
M manifests/misc/statistics.pp
1 file changed, 29 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/53/186253/1

diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp
index f3c59bf..2fc7185 100644
--- a/manifests/misc/statistics.pp
+++ b/manifests/misc/statistics.pp
@@ -242,11 +242,12 @@
     # generates the new mobile pageviews report
     # and syncs the file PageViewsPerMonthAll.csv to stat1002
     cron { 'new mobile pageviews report':
-        command  => "/bin/bash 
${misc::statistics::base::working_path}/wikistats_git/pageviews_reports/bin/stat1-cron-script.sh",
-        user     => 'stats',
-        monthday => 1,
-        hour     => 7,
-        minute   => 20,
+        command     => "/bin/bash 
${misc::statistics::base::working_path}/wikistats_git/pageviews_reports/bin/stat1-cron-script.sh",
+        user        => 'stats',
+        environment => 'MAILTO=""',
+        monthday    => 1,
+        hour        => 7,
+        minute      => 20,
     }
 }
 
@@ -645,10 +646,11 @@
     # This requires that the $misc::statistics::user::username
     # user is installed on the source host.
     cron { "rsync_${name}_logs":
-        command => "/usr/bin/rsync -rt --perms --chmod=g-w ${source} 
${destination}/",
-        user    => $misc::statistics::user::username,
-        hour    => 8,
-        minute  => 0,
+        command     => "/usr/bin/rsync -rt --perms --chmod=g-w ${source} 
${destination}/",
+        user        => $misc::statistics::user::username,
+        environment => 'MAILTO=""',
+        hour        => 8,
+        minute      => 0,
     }
 
     $prune_old_logs_ensure = $retention_days ? {
@@ -657,11 +659,12 @@
     }
 
     cron { "prune_old_${name}_logs":
-        ensure  => $prune_old_logs_ensure,
-        command => "/usr/bin/find ${destination} -ctime +${retention_days} 
-exec rm {} \\;",
-        user    => $misc::statistics::user::username,
-        minute  => 0,
-        hour    => 9,
+        ensure      => $prune_old_logs_ensure,
+        command     => "/usr/bin/find ${destination} -ctime +${retention_days} 
-exec rm {} \\;",
+        user        => $misc::statistics::user::username,
+        environment => 'MAILTO=""',
+        minute      => 0,
+        hour        => 9,
     }
 }
 
@@ -1175,11 +1178,12 @@
 
     # Cron for doing the basic aggregation step itself
     cron { 'aggregator projectcounts aggregate':
-        command => "${script_path}/bin/aggregate_projectcounts --source 
${hdfs_source_path} --target ${data_path} --first-date=`date --date='-8 day' 
+\\%Y-\\%m-\\%d` --last-date=`date --date='-1 day' +\\%Y-\\%m-\\%d` 
--push-target --log ${log_path}/`date +\\%Y-\\%m-\\%d--\\%H-\\%M-\\%S`.log",
-        user    => $user,
-        hour    => '13',
-        minute  => '0',
-        require => [
+        command     => "${script_path}/bin/aggregate_projectcounts --source 
${hdfs_source_path} --target ${data_path} --first-date=`date --date='-8 day' 
+\\%Y-\\%m-\\%d` --last-date=`date --date='-1 day' +\\%Y-\\%m-\\%d` 
--push-target --log ${log_path}/`date +\\%Y-\\%m-\\%d--\\%H-\\%M-\\%S`.log",
+        user        => $user,
+        environment => 'MAILTO=""',
+        hour        => '13',
+        minute      => '0',
+        require     => [
             Git::Clone['aggregator_code'],
             Git::Clone['aggregator_data'],
             File[$log_path],
@@ -1188,10 +1192,11 @@
 
     # Cron for basing monitoring of the aggregated data
     cron { 'aggregator projectcounts monitor':
-        command => "${script_path}/bin/check_validity_aggregated_projectcounts 
--data ${data_path}",
-        user    => $user,
-        hour    => '13',
-        minute  => '45',
-        require => Cron['aggregator projectcounts aggregate'],
+        command     => 
"${script_path}/bin/check_validity_aggregated_projectcounts --data 
${data_path}",
+        user        => $user,
+        environment => 'MAILTO=""',
+        hour        => '13',
+        minute      => '45',
+        require     => Cron['aggregator projectcounts aggregate'],
     }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iff1961cf1a617aa2be043a5458a1eefbab04c258
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: QChris <christ...@quelltextlich.at>
Gerrit-Reviewer: Ottomata <o...@wikimedia.org>

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

Reply via email to