7aa04287a3e7c91dbd567ebaa9673ba2ae74c2d5
[mirror/dsa-puppet.git] / modules / bacula / manifests / storage / client.pp
1 # Bacula storage configuration for a client.
2 #
3 # This is stored config by a client and then collected on the storage
4 #
5 # @param client The name of the client (relevant for device names, media type names, etc.)
6 define bacula::storage::client(
7   String $client = $name
8 ) {
9   include bacula::storage
10
11   $device_name     = "${bacula::storage::filestor_device}-${client}"
12   $media_type_name = "${bacula::storage::filestor_name}-${client}"
13   $directory       = "${bacula::storage::backup_path}/${client}"
14
15   file {
16     "/etc/bacula/storage-conf.d/${client}.conf":
17       content => template('bacula/storage/sd-per-client.conf.erb'),
18       mode    => '0440',
19       group   => bacula,
20       notify  => Exec['bacula-sd restart-when-idle'],
21       ;
22     $directory:
23       ensure => directory,
24       mode   => '0755',
25       owner  => bacula,
26       group  => bacula,
27       ;
28   }
29 }