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

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

Overview

Parameters:

  • rsync_mirrors (Any) (defaults to: lookup('profile::dumps::distribution::mirrors'))
  • rsyncer_settings (Any) (defaults to: lookup('profile::dumps::distribution::rsync_config'))
  • xmldumpsdir (Any) (defaults to: lookup('profile::dumps::distribution::xmldumpspublicdir'))
  • miscdatasetsdir (Any) (defaults to: lookup('profile::dumps::distribution::miscdumpsdir'))


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

class profile::dumps::distribution::mirrors::rsync_config(
    $rsync_mirrors = lookup('profile::dumps::distribution::mirrors'),
    $rsyncer_settings = lookup('profile::dumps::distribution::rsync_config'),
    $xmldumpsdir = lookup('profile::dumps::distribution::xmldumpspublicdir'),
    $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'],
    }
}