-
Notifications
You must be signed in to change notification settings - Fork 124
Expand file tree
/
Copy pathmodule.pp
More file actions
71 lines (70 loc) · 2.84 KB
/
module.pp
File metadata and controls
71 lines (70 loc) · 2.84 KB
1
2
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Definition: rsync::server::module
#
# sets up a rsync server
#
# Parameters:
# $path - path to data
# $comment - rsync comment
# $read_only - yes||no, defaults to yes
# $write_only - yes||no, defaults to no
# $list - yes||no, defaults to yes
# $uid - uid of rsync server, defaults to 0
# $gid - gid of rsync server, defaults to 0
# $incoming_chmod - incoming file mode, defaults to no chmod
# $outgoing_chmod - outgoing file mode, defaults to no chmod
# $max_connections - maximum number of simultaneous connections allowed, defaults to 0
# $lock_file - file used to support the max connections parameter, defaults to /var/run/rsyncd.lock
# only needed if max_connections > 0
# $secrets_file - path to the file that contains the username:password pairs used for authenticating this module
# $auth_users - list of usernames that will be allowed to connect to this module (must be undef or an array)
# $hosts_allow - list of patterns allowed to connect to this module (man 5 rsyncd.conf for details, must be undef or an array)
# $hosts_deny - list of patterns allowed to connect to this module (man 5 rsyncd.conf for details, must be undef or an array)
# $transfer_logging - parameter enables per-file logging of downloads and
# uploads in a format somewhat similar to that used by ftp daemons.
# $log_format - This parameter allows you to specify the format used
# for logging file transfers when transfer logging is enabled. See the
# rsyncd.conf documentation for more details.
# $refuse_options - list of rsync command line options that will be refused by your rsync daemon.
# $log_file - log messages to the indicated file rather than using syslog
#
# sets up an rsync server
#
# Requires:
# $path must be set
#
# Sample Usage:
# # setup default rsync repository
# rsync::server::module { 'repo':
# path => $base,
# require => File[$base],
# }
#
define rsync::server::module (
$path,
$order = "10_${name}",
$comment = undef,
$read_only = 'yes',
$write_only = 'no',
$list = 'yes',
$uid = '0',
$gid = '0',
$incoming_chmod = undef,
$outgoing_chmod = undef,
$max_connections = '0',
$lock_file = '/var/run/rsyncd.lock',
$secrets_file = undef,
$exclude = undef,
$auth_users = undef,
$hosts_allow = undef,
$hosts_deny = undef,
$transfer_logging = undef,
$log_file = undef,
$log_format = undef,
$refuse_options = undef,
$ignore_nonreadable = undef) {
concat::fragment { "frag-${name}":
content => template('rsync/module.erb'),
target => $rsync::server::conf_file,
order => $order,
}
}