Dzahn has submitted this change and it was merged.

Change subject: Gerrit: Setup rsync between old and new machines
......................................................................


Gerrit: Setup rsync between old and new machines

Setup rsyncd on the new server, lead, to copy from the
old server, ytterbium, and push gerrit data.

Note how i changed the actual rsync command in the cron,
switched the order of source and destination, since we are
pushing.

Bug:T125018
Change-Id: Id9d3020a3be0f848e9a39b878664758a5a2b6cfd
---
M manifests/site.pp
A modules/gerrit/manifests/migration/destination.pp
A modules/gerrit/manifests/migration/source.pp
3 files changed, 36 insertions(+), 0 deletions(-)

Approvals:
  Chad: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/manifests/site.pp b/manifests/site.pp
index bf9ddef..84dd807 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -1542,6 +1542,7 @@
 node 'lead.wikimedia.org' {
     # Note: whenever moving Gerrit out of ytterbium, you will need
     # to update the role::zuul::configuration variable 'gerrit_server'
+    include gerrit::migration::destination
     include standard
     include base::firewall
 }
@@ -2908,6 +2909,8 @@
     # Note: whenever moving Gerrit out of ytterbium, you will need
     # to update the role::zuul::configuration variable 'gerrit_server'
     role gerrit::server
+
+    include gerrit::migration::source
     include standard
 
     interface::add_ip6_mapped { 'main': }
diff --git a/modules/gerrit/manifests/migration/destination.pp 
b/modules/gerrit/manifests/migration/destination.pp
new file mode 100644
index 0000000..38be725
--- /dev/null
+++ b/modules/gerrit/manifests/migration/destination.pp
@@ -0,0 +1,25 @@
+# sets up rsync for a migration of gerrit's git data to a new server
+class gerrit::migration::destination {
+
+    $sourceip='208.80.154.80'
+
+    ferm::service { 'gerrit-migration-rsync':
+        proto  => 'tcp',
+        port   => '873',
+        srange => "${sourceip}/32",
+    }
+
+    include rsync::server
+
+    file { [ '/srv/gerrit/', '/srv/gerrit/git' ]:
+        ensure => 'directory',
+    }
+
+    rsync::server::module { 'gerrit_git_data':
+        path        => '/srv/gerrit/git',
+        read_only   => 'no',
+        hosts_allow => $sourceip,
+        require     => File['/srv/gerrit/git'],
+    }
+}
+
diff --git a/modules/gerrit/manifests/migration/source.pp 
b/modules/gerrit/manifests/migration/source.pp
new file mode 100644
index 0000000..02a813e
--- /dev/null
+++ b/modules/gerrit/manifests/migration/source.pp
@@ -0,0 +1,8 @@
+class gerrit::migration::source {
+    $cmd = '/usr/bin/rsync -rlpt /var/lib/gerrit2/review_site/git 
rsync://lead::gerrit_git_data'
+    cron { 'rsync_gerrit_data':
+        command => $cmd,
+        user    => 'root',
+        hour    => [0, 6, 12, 18]
+    }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id9d3020a3be0f848e9a39b878664758a5a2b6cfd
Gerrit-PatchSet: 10
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com>
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