+# the bacula storage node
+#
+# @param backup_path the directory where backups should be stored
+class bacula::storage (
+ String $backup_path = '/srv/bacula',
+) inherits bacula {
+ package { 'bacula-sd':
+ ensure => installed
+ }
+
+ service { 'bacula-sd':
+ ensure => running,
+ enable => true,
+ hasstatus => true,
+ }
+ dsa_systemd::override { 'bacula-sd':
+ content => @(EOT)
+ [Service]
+ Group=bacula
+ SupplementaryGroups=ssl-cert
+ | EOT
+ }
+
+ exec { 'bacula-sd restart-when-idle':
+ path => '/usr/bin:/usr/sbin:/bin:/sbin',
+ command => "sh -c 'setsid /usr/local/sbin/bacula-idle-restart ${bacula::bacula_storage_port} bacula-sd &'",
+ refreshonly => true,
+ subscribe => File[$bacula::bacula_ssl_server_cert],
+ require => File['/usr/local/sbin/bacula-idle-restart'],
+ }