bconsole is only needed on the director
[mirror/dsa-puppet.git] / modules / bacula / manifests / director.pp
1 class bacula::director inherits bacula {
2
3         package { ['bacula-director-pgsql', 'bacula-common', 'bacula-common-pgsql']:
4                 ensure => installed
5         }
6
7         service { 'bacula-director':
8                 ensure    => running,
9                 enable    => true,
10                 hasstatus => true,
11                 require   => Package['bacula-director-pgsql']
12         }
13
14         file { '/etc/bacula/conf.d':
15                 ensure  => directory,
16                 mode    => '0755',
17                 group   => bacula,
18                 purge   => true,
19                 force   => true,
20                 recurse => true,
21                 source  => 'puppet:///files/empty/',
22                 notify  => Service['bacula-director']
23         }
24
25         file { '/etc/bacula/bacula-dir.conf':
26                 content => template('bacula/bacula-dir.conf.erb'),
27                 mode    => '0440',
28                 group   => bacula,
29                 require => Package['bacula-director-pgsql'],
30                 notify  => Service['bacula-director']
31         }
32
33         @ferm::rule { 'dsa-bacula-dir':
34                 domain      => '(ip ip6)',
35                 description => 'Allow bacula access from localhost',
36                 rule        => "proto tcp mod state state (NEW) dport (bacula-dir) saddr (${bacula_director_address} localhost) ACCEPT",
37         }
38
39         file { '/etc/bacula/conf.d/empty.conf':
40                 content => '',
41                 mode    => '0440',
42                 group   => bacula,
43                 require => Package['bacula-director-pgsql'],
44                 notify  => Service['bacula-director']
45         }
46
47         Bacula::Node<<| |>>
48
49         package { 'bacula-console':
50                 ensure => installed;
51         }
52
53         file { '/etc/bacula/bconsole.conf':
54                 content => template('bacula/bconsole.conf.erb'),
55                 mode    => '0640',
56                 group   => bacula,
57                 require => Package['bacula-console']
58         }
59 }