Puppet Class: profile::ci::data_rsync

Defined in:
modules/profile/manifests/ci/data_rsync.pp

Overview

SPDX-License-Identifier: Apache-2.0 allow rsyncing data between CI servers during server migrations

Parameters:

  • src_host (Stdlib::Fqdn) (defaults to: lookup(profile::ci::migration::rsync_src_host))
  • dst_hosts (Array[Stdlib::Fqdn]) (defaults to: lookup(profile::ci::migration::rsync_dst_hosts))
  • data_dirs (Array[Stdlib::Unixpath]) (defaults to: lookup(profile::ci::migration::rsync_data_dirs))


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
# File 'modules/profile/manifests/ci/data_rsync.pp', line 3

class profile::ci::data_rsync (
    Stdlib::Fqdn $src_host = lookup(profile::ci::migration::rsync_src_host),
    Array[Stdlib::Fqdn] $dst_hosts = lookup(profile::ci::migration::rsync_dst_hosts),
    Array[Stdlib::Unixpath] $data_dirs = lookup(profile::ci::migration::rsync_data_dirs),
) {

    if $::fqdn in $dst_hosts {

        firewall::service { 'ci-migration-rsync':
            proto  => 'tcp',
            port   => 873,
            srange => [$src_host],
        }

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

        $data_dirs.each |String $data_dir| {

            $module_name = regsubst($data_dir, '\/', '-', 'G')

            rsync::server::module { "ci-${module_name}":
                path        => $data_dir,
                read_only   => 'no',
                hosts_allow => [$src_host],
            }
        }
    }
}