add another rule
[mirror/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         exec { 'bacula-sd restart-when-idle':
14                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
15                 command     => 'sh -c "setsid /usr/local/sbin/bacula-idle-restart sd &"',
16                 refreshonly => true,
17                 subscribe   => File[$bacula_ssl_server_cert],
18                 require     => File['/usr/local/sbin/bacula-idle-restart'],
19         }
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  => Exec['bacula-sd restart-when-idle']
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 restart-when-idle']
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 5.153.231.125 5.153.231.126) 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 restart-when-idle']
59         }
60
61         file { "${bacula_backup_path}/Catalog":
62                 ensure  => directory,
63                 mode    => '0755',
64                 owner   => bacula,
65                 group   => bacula,
66                 ;
67         }
68
69         Bacula::Storage-per-Node<<| |>>
70
71 }