-
-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathstorage.pp
More file actions
47 lines (45 loc) · 2.22 KB
/
Copy pathstorage.pp
File metadata and controls
47 lines (45 loc) · 2.22 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
# @summary Configure a Bacula Director Storage resource
#
# This define creates a storage declaration for the director. This informs the
# director which storage servers are available to send client backups to.
#
# This resource is intended to be used from bacula::storage as an exported
# resource, so that each storage server is available as a configuration on the
# director.
#
# @param address Bacula director configuration for Storage option 'SDAddress'
# @param port Bacula director configuration for Storage option 'SDPort'
# @param password Bacula director configuration for Storage option 'Password'
# @param device_name Bacula director configuration for Storage option 'Device'
# @param media_type Bacula director configuration for Storage option 'Media Type'
# @param maxconcurjobs DEPRECATED Bacula director configuration for Storage option 'Maximum Concurrent Jobs'
# @param max_concurrent_jobs Bacula director configuration for Storage option 'Maximum Concurrent Jobs'
# @param conf_dir Bacula configuration directory
#
define bacula::director::storage (
Sensitive[String[1]] $password,
String[1] $address = $name,
Stdlib::Port $port = 9103,
String[1] $device_name = "${facts['networking']['fqdn']}-device",
String[1] $media_type = 'File',
Optional[Integer[1]] $maxconcurjobs = undef,
Integer[1] $max_concurrent_jobs = 1,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
) {
if $maxconcurjobs {
deprecation('bacula::director::maxconcurjobs', 'This parameter is deprecated. Use bacula::director::max_concurrent_jobs instead.')
}
$epp_storage_variables = {
name => $name,
address => $address,
port => $port,
password => $password,
device_name => $device_name,
media_type => $media_type,
max_concurrent_jobs => pick($maxconcurjobs, $max_concurrent_jobs),
}
concat::fragment { "bacula-director-storage-${name}":
target => "${conf_dir}/conf.d/storage.conf",
content => epp('bacula/bacula-dir-storage.epp', $epp_storage_variables),
}
}