1 # Bacula client config on the director
3 # This is stored config by a client, collected on the director
5 # @param client The name of the client (relevant for device names, media type names, etc.)
7 # @param storage_address Address of the storage daemon
8 # @param port_sd Port of the storage daemon
9 # @param storage_secret Shared secret between storage and director
10 # @param storage_device_name Device name on the storage daemon for this node's backups
11 # @param storage_media_type_name Media type name on the storage daemon for this node's backupse
12 define bacula::director::client_from_storage (
13 Stdlib::Host $storage_address,
15 String $storage_secret,
16 String $storage_device_name,
17 String $storage_media_type_name,
19 Stdlib::Host $client = $name,
21 include bacula::director
23 $bacula_ca_path = $bacula::bacula_ca_path
24 $bacula_ssl_client_cert = $bacula::bacula_ssl_client_cert
25 $bacula_ssl_client_key = $bacula::bacula_ssl_client_key
27 # For historical reasons, we use the same string for
28 # director-internal storage name as we do for mediate
29 # type names. If we ever blow away the catalog and start
30 # again, we should probably pick a different string here
32 $storage_name = $storage_media_type_name
34 # we define this in both bacula::director::client_from_storage and
35 # bacula::director::client and it needs to match.
36 $pool_name = "${bacula::director::pool_name}-${client}"
38 file { "/etc/bacula/conf.d/${client}_storage.conf":
39 content => template('bacula/director/dir-per-client-from-storage.erb'),
42 notify => Exec['bacula-director reload']
45 file { "/etc/bacula/storages-list.d/${client}.storage":
46 content => "${storage_name}\n",
49 notify => Exec['bacula-director reload']