1 # our bacula client configuration
3 # this mostly configures the file daemon, but also firewall rules and
4 # fragments to sent to the other servers.
6 Enum['present', 'absent'] $ensure = defined(Class['bacula::not_a_client']) ? { true => 'absent', default => 'present' },
8 $package_ensure = $ensure ? { 'present' => 'installed', 'absent' => 'purged' }
9 $service_ensure = $ensure ? { 'present' => 'running', 'absent' => 'stopped' }
10 $service_enable = $ensure ? { 'present' => true, 'absent' => false }
11 $reverse_ensure = $ensure ? { 'present' => 'absent', 'absent' => 'present' }
13 if $ensure == 'present' {
14 @@bacula::storage_per_node { $::fqdn: }
16 @@bacula::node { $::fqdn:
17 bacula_client_port => $bacula::bacula_client_port,
20 @@concat::fragment { "bacula-dsa-client-list::${::fqdn}":
21 target => $bacula::bacula_dsa_client_list ,
25 tag => $bacula::tag_bacula_dsa_client_list,
28 # allow access from director
29 Ferm::Rule::Simple <<| tag == 'bacula::director-to-fd' |>> {
30 port => $bacula::bacula_client_port,
32 } elsif $ensure == 'absent' {
45 ensure => $package_ensure
48 service { 'bacula-fd':
49 ensure => $service_ensure,
50 enable => $service_enable,
52 require => Package['bacula-fd']
55 exec { 'bacula-fd restart-when-idle':
56 path => '/usr/bin:/usr/sbin:/bin:/sbin',
57 command => 'sh -c "setsid /usr/local/sbin/bacula-idle-restart fd &"',
59 subscribe => [ File[$bacula::bacula_ssl_server_cert], File[$bacula::bacula_ssl_client_cert] ],
60 require => File['/usr/local/sbin/bacula-idle-restart'],
63 file { '/etc/bacula/bacula-fd.conf':
65 content => template('bacula/bacula-fd.conf.erb'),
69 require => Package['bacula-fd'],
70 notify => Exec['bacula-fd restart-when-idle'],
72 file { '/usr/local/sbin/bacula-backup-dirs':
75 source => 'puppet:///modules/bacula/bacula-backup-dirs',
77 file { '/usr/local/sbin/postbaculajob':
80 source => 'puppet:///modules/bacula/postbaculajob',
82 file { '/etc/default/bacula-fd':
84 content => template('bacula/default.bacula-fd.erb'),
88 require => Package['bacula-fd'],
89 notify => Service['bacula-fd'],
91 if (versioncmp($::lsbmajdistrelease, '9') >= 0 and $facts['systemd']) {
92 dsa_systemd::override { 'bacula-fd':
96 ExecStart=/usr/sbin/bacula-fd -c $CONFIG -f -u bacula -k
100 dsa_systemd::override { 'bacula-fd':