1 # the bacula storage node
2 class bacula::storage inherits bacula {
12 dsa_systemd::override { 'bacula-sd':
16 SupplementaryGroups=ssl-cert
20 exec { 'bacula-sd restart-when-idle':
21 path => '/usr/bin:/usr/sbin:/bin:/sbin',
22 command => "sh -c 'setsid /usr/local/sbin/bacula-idle-restart ${bacula::bacula_storage_port} bacula-sd &'",
24 subscribe => File[$bacula::bacula_ssl_server_cert],
25 require => File['/usr/local/sbin/bacula-idle-restart'],
29 file { '/etc/bacula/bacula-sd.conf':
30 content => template('bacula/bacula-sd.conf.erb'),
33 notify => Exec['bacula-sd restart-when-idle']
36 file { '/etc/bacula/storage-conf.d':
43 source => 'puppet:///files/empty/',
44 notify => Exec['bacula-sd restart-when-idle']
47 # allow access from director and fds
48 ferm::rule::simple { 'dsa-bacula-sd':
49 description => 'Access to the bacula-storage',
50 port => $bacula::bacula_storage_port,
51 target => 'bacula-sd',
53 Ferm::Rule::Simple <<| tag == "bacula::director-to-storage::${bacula::bacula_director_address}" |>>;
54 Ferm::Rule::Simple <<| tag == "bacula::fd-to-storage::${::fqdn}" |>>;
56 file { '/etc/bacula/storage-conf.d/empty.conf':
60 notify => Exec['bacula-sd restart-when-idle']
63 package { 'python3-psycopg2': ensure => installed }
64 file { '/usr/local/bin/bacula-unlink-removed-volumes':
65 source => 'puppet:///modules/bacula/bacula-unlink-removed-volumes',
68 file { '/etc/cron.d/puppet-bacula-storage-stuff': ensure => absent, }
69 concat::fragment { 'puppet-crontab--bacula-storage':
70 target => '/etc/cron.d/puppet-crontab',
72 @daily bacula chronic /usr/local/bin/bacula-unlink-removed-volumes -v
76 Bacula::Storage_per_node<<| |>>