de4f25ef468392b5b18099bbf871988c94432274
[mirror/dsa-puppet.git] / modules / bacula / manifests / storage / director.pp
1 # Bacula sd config: director snippet
2 #
3 # Each/The director exports this class to be collected by each/the storage.
4 #
5 # @param director_name     bacula name of the dir instance
6 # @param director_address  address of this dir instance that other instances should connect to (dns name)
7 define bacula::storage::director(
8   String $director_name,
9   Stdlib::Host $director_address,
10 ) {
11   include bacula::storage
12
13   # this is created in both bacula::storage::client and
14   # bacula::storage::director and needs to be the same
15   $dir_storage_secret = hkdf('/etc/puppet/secret', "bacula::director<->storage::${director_address}<->${::fqdn}")
16
17   file {
18     "/etc/bacula/storage-conf.d/Dir_${director_address}.conf":
19       content => template('bacula/storage/sd-per-director.conf.erb'),
20       mode    => '0440',
21       group   => bacula,
22       notify  => Exec['bacula-sd restart-when-idle'],
23       ;
24   }
25 }