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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'modules/rsync/manifests/server.pp', line 10
class rsync::server(
Variant[
Stdlib::IP::Address,
Enum['']
] $address = '0.0.0.0',
Integer $timeout = 300,
Stdlib::Yes_no $use_chroot = 'yes',
Array $rsync_opts = [],
Hash $rsyncd_conf = {},
Stdlib::Ensure::Service $ensure_service = 'running',
Optional[Stdlib::Unixpath] $log_file = undef,
) {
ensure_packages(['rsync'])
$rsync_conf = '/etc/rsyncd.conf'
$rsync_pid = '/var/run/rsync.pid'
concat { $rsync_conf:
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
}
# rsync daemon defaults file
file { '/etc/default/rsync':
ensure => present,
mode => '0444',
owner => 'root',
group => 'root',
content => template('rsync/rsync.default.erb'),
}
# TODO: When we have migrated all rsync usage off of cleartext and to use stunnel,
# we can ensure => stopped this. https://phabricator.wikimedia.org/T237424
service { 'rsync':
ensure => $ensure_service,
enable => true,
require => Package['rsync'],
subscribe => [Concat[$rsync_conf], File['/etc/default/rsync']],
}
# Cleanup the old method of concatenating the config
file { '/etc/rsync.d':
ensure => absent,
recurse => true,
purge => true,
force => true,
}
concat::fragment { "${rsync_conf}-header":
target => $rsync_conf,
order => '01',
content => template('rsync/header.erb'),
}
}
|