QChris has uploaded a new change for review.

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


Change subject: Backup geowiki's data-private bare repository
......................................................................

Backup geowiki's data-private bare repository

The bare repository is not in gerrit, as it contains "foundation only"
data, and we do not trust gerrit to keep it private. So we backup the
repository separately.

Change-Id: I1ecffb8fbef9c9652c528a401f853e2b83bb2860
---
M manifests/misc/statistics.pp
M manifests/role/backup.pp
2 files changed, 21 insertions(+), 5 deletions(-)


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

diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp
index ceb1f5d..789cc57 100644
--- a/manifests/misc/statistics.pp
+++ b/manifests/misc/statistics.pp
@@ -834,14 +834,21 @@
     }
 }
 
+# == Class misc::statistics::geowiki::params
+# Parameters for geowiki that get used outside this file
+class misc::statistics::geowiki::params {
+    $base_path = '/a/geowiki'
+    $private_data_bare_path = "${base_path}/data-private-bare"
+}
 
 # == Class misc::statistics::geowiki
 # Clones analytics/geowiki python scripts
 class misc::statistics::geowiki {
-    require misc::statistics::user
+    require misc::statistics::user,
+        misc::statistics::geowiki::params
 
     $geowiki_user = $misc::statistics::user::username
-    $geowiki_base_path = '/a/geowiki'
+    $geowiki_base_path = $misc::statistics::geowiki::params::base_path
     $geowiki_scripts_path = "${geowiki_base_path}/scripts"
 
     git::clone { 'geowiki-scripts':
@@ -889,11 +896,12 @@
 # Makes sure the geowiki's bare data-private repository is available.
 #
 class misc::statistics::geowiki::data::private_bare::sync {
-    require misc::statistics::geowiki
+    require misc::statistics::geowiki,
+        misc::statistics::geowiki::params
 
     $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"
+    $geowiki_private_data_bare_path = 
$misc::statistics::geowiki::params::private_data_bare_path
     $geowiki_private_data_bare_host = "stat1"
     $geowiki_private_data_bare_host_fqdn = 
"${geowiki_private_data_bare_host}.wikimedia.org"
 
@@ -905,8 +913,12 @@
     }
 
     # The bare repository lives on stat1, so it's available there directly.
+    # It only needs backup (as the repo is not living in gerrit)
     # Other hosts need to rsync it over
-    if $::hostname != $geowiki_private_data_bare_host {
+    if $::hostname == $geowiki_private_data_bare_host {
+        include backup::host
+        backup::set { 'a-geowiki-data-private-bare': }
+    } else {
         cron { 'geowiki data-private bare sync':
             command => "/usr/bin/rsync -rt --delete 
rsync://${geowiki_private_data_bare_host_fqdn}${geowiki_private_data_bare_path}/
 ${geowiki_private_data_bare_path}/",
             require => File["$geowiki_private_data_bare_path"],
diff --git a/manifests/role/backup.pp b/manifests/role/backup.pp
index 03d8105..01a6157 100644
--- a/manifests/role/backup.pp
+++ b/manifests/role/backup.pp
@@ -11,6 +11,7 @@
     include backup::host
     include role::backup::config
     include passwords::bacula
+    require misc::statistics::geowiki::params
 
     system::role { 'role::backup::director': description => 'Backup server' }
 
@@ -72,6 +73,9 @@
     bacula::director::fileset { 'a-eventlogging':
         includes => [ '/a/eventlogging' ]
     }
+    bacula::director::fileset { 'a-geowiki-data-private-bare':
+        includes => [ 
$misc::statistics::geowiki::params::private_data_bare_path ]
+    }
     bacula::director::fileset { 'home':
         includes => [ '/home' ]
     }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ecffb8fbef9c9652c528a401f853e2b83bb2860
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: QChris <christ...@quelltextlich.at>

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

Reply via email to