Puppet Class: profile::gerrit::migration
- Defined in:
- modules/profile/manifests/gerrit/migration.pp
Overview
Allow rsyncing gerrit data to another server for migration and reinstalls.
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('profile::gerrit::migration::src_host'),
Array[Stdlib::Fqdn] $dst_hosts = lookup('profile::gerrit::migration::dst_hosts'),
Stdlib::Unixpath $data_dir = lookup('profile::gerrit::migration::data_dir'),
) {
if $facts['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,
}
}
}
|