Puppet Class: profile::dumps::distribution::mirrors::rsync_config

Defined in:
modules/profile/manifests/dumps/distribution/mirrors/rsync_config.pp

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • rsync_mirrors (Array) (defaults to: lookup('profile::dumps::distribution::mirrors'))
  • rsyncer_settings (Hash) (defaults to: lookup('profile::dumps::distribution::rsync_config'))
  • xmldumpsdir (Stdlib::Unixpath) (defaults to: lookup('profile::dumps::distribution::xmldumpspublicdir'))
  • miscdatasetsdir (Stdlib::Unixpath) (defaults to: lookup('profile::dumps::distribution::miscdumpsdir'))


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'modules/profile/manifests/dumps/distribution/mirrors/rsync_config.pp', line 2

class profile::dumps::distribution::mirrors::rsync_config(
    Array $rsync_mirrors = lookup('profile::dumps::distribution::mirrors'),
    Hash $rsyncer_settings = lookup('profile::dumps::distribution::rsync_config'),
    Stdlib::Unixpath $xmldumpsdir = lookup('profile::dumps::distribution::xmldumpspublicdir'),
    Stdlib::Unixpath $miscdatasetsdir = lookup('profile::dumps::distribution::miscdumpsdir'),
) {
    $active_mirrors = $rsync_mirrors.filter |$item| { $item['active'] == 'yes' }
    $ipv4_mirrors = $active_mirrors.reduce([]) |$mirrorlist, $item| { $mirrorlist + $item['ipv4'] }
    $ipv6_mirrors = $active_mirrors.reduce([]) |$mirrorlist, $item| { $mirrorlist + $item['ipv6'] }

    $hosts_allow = join(flatten($ipv4_mirrors + $ipv6_mirrors), ' ')

    file { '/etc/rsyncd.d/20-rsync-dumps_to_public.conf':
        ensure  => 'present',
        mode    => '0444',
        owner   => 'root',
        group   => 'root',
        content => template('profile/dumps/distribution/mirrors/rsyncd.conf.dumps_to_public.erb'),
        notify  => Exec['update-rsyncd.conf'],
    }
}