1 # the bacula storage node
3 # @param backup_path the directory where backups should be stored
4 class bacula::storage (
5 String $backup_path = '/srv/bacula',
11 service { 'bacula-sd':
16 dsa_systemd::override { 'bacula-sd':
20 SupplementaryGroups=ssl-cert
24 exec { 'bacula-sd restart-when-idle':
25 path => '/usr/bin:/usr/sbin:/bin:/sbin',
26 command => "sh -c 'setsid /usr/local/sbin/bacula-idle-restart ${bacula::bacula_storage_port} bacula-sd &'",
28 subscribe => File[$bacula::bacula_ssl_server_cert],
29 require => File['/usr/local/sbin/bacula-idle-restart'],
33 file { '/etc/bacula/bacula-sd.conf':
34 content => template('bacula/bacula-sd.conf.erb'),
37 notify => Exec['bacula-sd restart-when-idle']
40 file { '/etc/bacula/storage-conf.d':
47 source => 'puppet:///files/empty/',
48 notify => Exec['bacula-sd restart-when-idle']
51 # allow access from director and fds
52 ferm::rule::simple { 'dsa-bacula-sd':
53 description => 'Access to the bacula-storage',
54 port => $bacula::bacula_storage_port,
55 target => 'bacula-sd',
57 Ferm::Rule::Simple <<| tag == "bacula::director-to-storage::${bacula::bacula_director_address}" |>>;
58 Ferm::Rule::Simple <<| tag == "bacula::fd-to-storage::${::fqdn}" |>>;
60 file { '/etc/bacula/storage-conf.d/empty.conf':
64 notify => Exec['bacula-sd restart-when-idle']
67 package { 'python3-psycopg2': ensure => installed }
68 file { '/usr/local/bin/bacula-unlink-removed-volumes':
69 source => 'puppet:///modules/bacula/bacula-unlink-removed-volumes',
72 file { '/etc/cron.d/puppet-bacula-storage-stuff': ensure => absent, }
73 concat::fragment { 'puppet-crontab--bacula-storage':
74 target => '/etc/cron.d/puppet-crontab',
76 @daily bacula chronic /usr/local/bin/bacula-unlink-removed-volumes -v
80 Bacula::Storage_per_node<<| |>>