Puppet Class: profile::gerrit::migration

Defined in:
modules/profile/manifests/gerrit/migration.pp

Overview

Allow rsyncing gerrit data to another server for migrations and reinstalls.

Parameters:

  • src_host (Stdlib::Fqdn) (defaults to: lookup(gerrit::server::rsync_src_host))
  • dst_hosts (Array[Stdlib::Fqdn]) (defaults to: lookup(gerrit::server::rsync_dst_hosts))
  • data_dir (Stdlib::Unixpath) (defaults to: lookup(gerrit::server::rsync_data_dir))


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'modules/profile/manifests/gerrit/migration.pp', line 3

class profile::gerrit::migration (
    Stdlib::Fqdn $src_host = lookup(gerrit::server::rsync_src_host),
    Array[Stdlib::Fqdn] $dst_hosts = lookup(gerrit::server::rsync_dst_hosts),
    Stdlib::Unixpath $data_dir = lookup(gerrit::server::rsync_data_dir),
) {

    if $::fqdn in $dst_hosts {

        ferm::service { 'gerrit-migration-rsync':
            proto  => 'tcp',
            port   => '873',
            srange => "(@resolve((${src_host})) @resolve((${src_host}), AAAA))",
        }

        class { '::rsync::server': }

        rsync::server::module { 'gerrit-data':
            path        => $data_dir,
            read_only   => 'no',
            hosts_allow => $src_host,
        }

        rsync::server::module { 'gerrit-var-lib':
            path        => '/var/lib/gerrit2/review_site',
            read_only   => 'no',
            hosts_allow => $src_host,
        }

        file { "/srv/home-${src_host}/":
            ensure => 'directory',
        }

        rsync::server::module { 'gerrit-home':
            path        => "/srv/home-${src_host}",
            read_only   => 'no',
            hosts_allow => $src_host,
        }
    }
}