Hello Ottomata,

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

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

to review the following change.

Change subject: Rsync geowiki's bare data-private repository to statistics' 
webservers
......................................................................

Rsync geowiki's bare data-private repository to statistics' webservers

Andrew said that we can trust the network, so there is no need to
encrypt the data when bringing it over to other hosts.

Change-Id: If57d2f42c59d24c1e5813da66a66fbea66a240bd
---
M manifests/misc/statistics.pp
M manifests/role/statistics.pp
2 files changed, 35 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/99/94299/1

diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp
index 1ce1a33..69a9604 100644
--- a/manifests/misc/statistics.pp
+++ b/manifests/misc/statistics.pp
@@ -863,6 +863,36 @@
     }
 }
 
+# == Class misc::statistics::geowiki::repo::data_private_bare
+# Makes sure the geowiki's bare data-private repository is available.
+#
+class misc::statistics::geowiki::repo::data_private_bare {
+    require misc::statistics::geowiki
+
+    $geowiki_user = $misc::statistics::geowiki::geowiki_user
+    $geowiki_base_path = $misc::statistics::geowiki::geowiki_base_path
+    $geowiki_private_data_bare_path = "${geowiki_base_path}/data-private-bare"
+
+    file { "$geowiki_private_data_bare_path":
+        ensure => directory,
+        owner  => $geowiki_user,
+        group  => $geowiki_user,
+        mode   => '0640',
+    }
+
+    # The bare repository lives on stat1, so it's available there directly.
+    # Other hosts need to rsync it over
+    if $::hostname != 'stat1' {
+        cron { 'geowiki data-private bare sync':
+            command => "/usr/bin/rsync -rt --delete 
rsync://stat1.wikimedia.org${geowiki_private_data_bare_path} 
${geowiki_private_data_bare_path}",
+            require => File["$geowiki_private_data_bare_path"],
+            user    => 'root',
+            hour  => '17',
+            minute  => '0',
+        }
+    }
+}
+
 # == Class misc::statistics::geowiki::jobs::data
 # Installs a cron job to get recent editor data
 # from the research slave databases and generate
@@ -922,6 +952,7 @@
 class misc::statistics::geowiki::jobs::limn {
     require misc::statistics::geowiki,
         misc::statistics::geowiki::mysql::conf::research,
+        misc::statistics::geowiki::repo::data_private_bare,
         misc::statistics::packages::python
 
     $geowiki_user = $misc::statistics::geowiki::geowiki_user
@@ -929,7 +960,7 @@
     $geowiki_scripts_path = $misc::statistics::geowiki::geowiki_scripts_path
     $geowiki_public_data_path = "${geowiki_base_path}/data-public"
     $geowiki_private_data_path = "${geowiki_base_path}/data-private"
-    $geowiki_private_data_bare_path = "${geowiki_base_path}/data-private-bare"
+    $geowiki_private_data_bare_path = 
$misc::statistics::geowiki::repo::data_private_bare::geowiki_private_data_bare_path
     $geowiki_mysql_research_conf_file = 
$misc::statistics::geowiki::mysql::conf::research::conf_file
 
     git::clone { 'geowiki-data-public':
diff --git a/manifests/role/statistics.pp b/manifests/role/statistics.pp
index 419c264..b0d8cdf 100644
--- a/manifests/role/statistics.pp
+++ b/manifests/role/statistics.pp
@@ -45,7 +45,9 @@
                # reportcard.wikimedia.org
                misc::statistics::sites::reportcard,
                # rsync public datasets from stat1 hourly
-               misc::statistics::public_datasets
+               misc::statistics::public_datasets,
+               # rsync geowiki's bare data-private from stat1 daily
+               misc::statistics::geowiki::repo::data_private_bare
 }
 
 class role::statistics::private inherits role::statistics {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If57d2f42c59d24c1e5813da66a66fbea66a240bd
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: QChris <[email protected]>
Gerrit-Reviewer: Ottomata <[email protected]>

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

Reply via email to