+ service { 'bacula-fd':
+ ensure => $service_ensure,
+ enable => $service_enable,
+ hasstatus => true,
+ require => Package['bacula-fd']
+ }
+
+ exec { 'bacula-fd restart-when-idle':
+ path => '/usr/bin:/usr/sbin:/bin:/sbin',
+ command => "sh -c 'setsid /usr/local/sbin/bacula-idle-restart ${port_fd} bacula-fd &'",
+ refreshonly => true,
+ subscribe => [ File[$bacula::bacula_ssl_server_cert], File[$bacula::bacula_ssl_client_cert] ],
+ require => File['/usr/local/sbin/bacula-idle-restart'],
+ }
+
+ file { '/etc/bacula/bacula-fd.conf':
+ ensure => $ensure,
+ content => template('bacula/bacula-fd.conf.erb'),
+ mode => '0640',
+ owner => root,
+ group => bacula,
+ require => Package['bacula-fd'],
+ notify => Exec['bacula-fd restart-when-idle'],
+ }
+ file { '/usr/local/sbin/bacula-backup-dirs':
+ ensure => $ensure,
+ mode => '0775',
+ source => 'puppet:///modules/bacula/bacula-backup-dirs',
+ }
+ file { '/usr/local/sbin/postbaculajob':
+ ensure => $ensure,
+ mode => '0775',
+ source => 'puppet:///modules/bacula/postbaculajob',
+ }
+ file { '/etc/default/bacula-fd':
+ ensure => $ensure,
+ content => template('bacula/default.bacula-fd.erb'),
+ mode => '0400',
+ owner => root,
+ group => root,
+ require => Package['bacula-fd'],
+ notify => Service['bacula-fd'],
+ }
+ if (versioncmp($::lsbmajdistrelease, '9') >= 0 and $facts['systemd']) {
+ dsa_systemd::override { 'bacula-fd':
+ content => @(EOT)
+ [Service]
+ ExecStart=
+ ExecStart=/usr/sbin/bacula-fd -c $CONFIG -f -u bacula -k
+ | EOT
+ }
+ } else {
+ dsa_systemd::override { 'bacula-fd':
+ ensure => absent,
+ }
+ }