Puppet Class: profile::phabricator::migration

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

Overview

SPDX-License-Identifier: Apache-2.0 Allow rsyncing phabricator data to other servers for hardware migration

Parameters:

  • src_host (Stdlib::Fqdn) (defaults to: lookup('profile::phabricator::migration::src_host'))
  • dst_hosts (Array[Stdlib::Fqdn]) (defaults to: lookup('profile::phabricator::migration::dst_hosts'))


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
42
43
44
45
46
47
48
49
# File 'modules/profile/manifests/phabricator/migration.pp', line 3

class profile::phabricator::migration (
    Stdlib::Fqdn        $src_host  = lookup('profile::phabricator::migration::src_host'),
    Array[Stdlib::Fqdn] $dst_hosts = lookup('profile::phabricator::migration::dst_hosts'),
) {

    systemd::sysuser { 'phd':
        ensure      => present,
        id          => '920:920',
        description => 'Phabricator daemon user',
        home_dir    => '/var/run/phd',
    }

    if $facts['fqdn'] in $dst_hosts {

        file { '/srv/repos':
            ensure => 'directory',
        }

        file { '/srv/dumps':
            ensure => 'directory',
        }

        file { '/srv/homes':
            ensure => 'directory',
        }

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

        class { 'rsync::server': }

        rsync::server::module { 'phabricator-srv-repos':
            path        => '/srv/repos',
            read_only   => 'no',
            hosts_allow => $src_host,
        }

        rsync::server::module { 'phabricator-srv-dumps':
            path        => '/srv/dumps',
            read_only   => 'no',
            hosts_allow => $src_host,
        }
    }
}