]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/manifests/storage.pp
7b1c1a8341a79ced3333f645a5fb1095758b8dde
[dsa-puppet.git] / modules / bacula / manifests / storage.pp
1 class bacula::storage inherits bacula {
2
3         package { 'bacula-sd':
4                 ensure => installed
5         }
6
7         service { 'bacula-sd':
8                 ensure    => running,
9                 enable    => true,
10                 hasstatus => true,
11         }
12
13         # should wait on -sd to finish current backups, then restart
14         # since it does not support reload and restarting kills running
15         # jobs
16         exec { 'bacula-sd reload':
17                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
18                 command     => 'true',
19                 refreshonly => true,
20         }
21
22         file { '/etc/bacula/bacula-sd.conf':
23                 content => template('bacula/bacula-sd.conf.erb'),
24                 mode    => '0640',
25                 group   => bacula,
26                 notify  => Service['bacula-sd']
27         }
28
29         file { '/etc/bacula/storage-conf.d':
30                 ensure  => directory,
31                 mode    => '0755',
32                 group   => bacula,
33                 purge   => true,
34                 force   => true,
35                 recurse => true,
36                 source  => 'puppet:///files/empty/',
37                 notify  => Exec['bacula-sd reload']
38         }
39
40         @ferm::rule { 'dsa-bacula-sd-v4':
41                 domain      => '(ip)',
42                 description => 'Allow bacula-sd access from director and clients',
43                 rule        => 'proto tcp mod state state (NEW) dport (bacula-sd) @subchain \'bacula-sd\' { saddr ($HOST_DEBIAN_V4) ACCEPT; }',
44                 notarule    => true,
45         }
46
47         @ferm::rule { 'dsa-bacula-sd-v6':
48                 domain      => '(ip6)',
49                 description => 'Allow bacula-sd access from director and clients',
50                 rule        => 'proto tcp mod state state (NEW) dport (bacula-sd) @subchain \'bacula-sd\' { saddr ($HOST_DEBIAN_V6) ACCEPT; }',
51                 notarule    => true,
52         }
53
54         file { '/etc/bacula/storage-conf.d/empty.conf':
55                 content => '',
56                 mode    => '0440',
57                 group   => bacula,
58                 notify  => Exec['bacula-sd reload']
59         }
60
61         Bacula::Storage-per-Node<<| |>>
62
63 }