1 # the bacula storage node
3 # @param backup_path the directory where backups should be stored
4 # @param filestor_device Storage device name prefix
5 # @param filestor_name Storage device media type name prefix
6 class bacula::storage (
7 String $backup_path = '/srv/bacula',
8 String $filestor_device = 'FileStorage',
9 String $filestor_name = 'File',
11 package { 'bacula-sd':
15 service { 'bacula-sd':
20 dsa_systemd::override { 'bacula-sd':
24 SupplementaryGroups=ssl-cert
28 exec { 'bacula-sd restart-when-idle':
29 path => '/usr/bin:/usr/sbin:/bin:/sbin',
30 command => "sh -c 'setsid /usr/local/sbin/bacula-idle-restart ${bacula::bacula_storage_port} bacula-sd &'",
32 subscribe => File[$bacula::bacula_ssl_server_cert],
33 require => File['/usr/local/sbin/bacula-idle-restart'],
37 file { '/etc/bacula/bacula-sd.conf':
38 content => template('bacula/bacula-sd.conf.erb'),
41 notify => Exec['bacula-sd restart-when-idle']
44 file { '/etc/bacula/storage-conf.d':
51 source => 'puppet:///files/empty/',
52 notify => Exec['bacula-sd restart-when-idle']
55 # allow access from director and fds
56 ferm::rule::simple { 'dsa-bacula-sd':
57 description => 'Access to the bacula-storage',
58 port => $bacula::bacula_storage_port,
59 target => 'bacula-sd',
61 Ferm::Rule::Simple <<| tag == "bacula::director-to-storage::${bacula::bacula_director_address}" |>>;
62 Ferm::Rule::Simple <<| tag == "bacula::fd-to-storage::${::fqdn}" |>>;
64 file { '/etc/bacula/storage-conf.d/empty.conf':
68 notify => Exec['bacula-sd restart-when-idle']
71 package { 'python3-psycopg2': ensure => installed }
72 file { '/usr/local/bin/bacula-unlink-removed-volumes':
73 source => 'puppet:///modules/bacula/bacula-unlink-removed-volumes',
76 file { '/etc/cron.d/puppet-bacula-storage-stuff': ensure => absent, }
77 concat::fragment { 'puppet-crontab--bacula-storage':
78 target => '/etc/cron.d/puppet-crontab',
80 @daily bacula chronic /usr/local/bin/bacula-unlink-removed-volumes -v
84 Bacula::Storage::Client<<| tag == "bacula::to-storage::${::fqdn}" |>>