]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/manifests/client.pp
c75a376767af6383f7dd9d41071bf49a8e898f2a
[dsa-puppet.git] / modules / bacula / manifests / client.pp
1 class bacula::client inherits bacula {
2         @@bacula::storage-per-node { $::fqdn: }
3
4         if $::hostname in [beethoven, berlioz, biber, diabelli, dinis, draghi, geo3, kaufmann, lully, master, picconi, pejacevic, reger, schumann, soler, vento, vieuxtemps, wilder, wolkenstein] {
5                 @@bacula::node { $::fqdn: }
6         }
7
8         package { ['bacula-fd']:
9                 ensure => installed
10         }
11
12         service { 'bacula-fd':
13                 ensure    => running,
14                 enable    => true,
15                 hasstatus => true,
16                 require   => Package['bacula-fd']
17         }
18
19         exec { 'bacula-fd restart-when-idle':
20                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
21                 command     => 'sh -c "setsid /usr/local/sbin/bacula-idle-restart fd &"',
22                 refreshonly => true,
23                 subscribe   => File['/etc/ssl/debian/certs/thishost.crt'],
24                 require     => File['/usr/local/sbin/bacula-idle-restart'],
25         }
26
27         file { '/etc/bacula/bacula-fd.conf':
28                 content => template('bacula/bacula-fd.conf.erb'),
29                 mode    => '0640',
30                 owner   => root,
31                 group   => bacula,
32                 require => Package['bacula-fd'],
33                 notify  => Service['bacula-fd'],
34         }
35         file { '/usr/local/sbin/postbaculajob':
36                 mode    => '0775',
37                 source  => 'puppet:///modules/bacula/postbaculajob',
38         }
39         file { '/etc/default/bacula-fd':
40                 content => template('bacula/default.bacula-fd.erb'),
41                 mode    => '0400',
42                 owner   => root,
43                 group   => root,
44                 require => Package['bacula-fd'],
45                 notify  => Service['bacula-fd'],
46         }
47         if $::lsbmajdistrelease < 7 {
48                 file { '/etc/apt/preferences.d/dsa-bacula-client':
49                         content => template('bacula/apt.preferences.bacula-client.erb'),
50                         mode    => '0444',
51                         owner   => root,
52                         group   => root,
53                 }
54         } else {
55                 file { '/etc/apt/preferences.d/dsa-bacula-client':
56                         ensure => absent
57                 }
58         }
59
60         @ferm::rule { 'dsa-bacula-fd-v4':
61                 domain      => '(ip)',
62                 description => 'Allow bacula access from storage and director',
63                 rule        => "proto tcp mod state state (NEW) dport (bacula-fd) saddr (${bacula_director_ip}) ACCEPT",
64         }
65
66         #@ferm::rule { 'dsa-bacula-fd-v6':
67         #       domain      => '(ip6)',
68         #       description => 'Allow bacula access from storage and director',
69         #       rule        => "proto tcp mod state state (NEW) dport (bacula-fd) saddr (${bacula_director_ip6}) ACCEPT",
70         #}
71 }