Split bacula_director_address into bacula_director_address and bacula_director_ip
[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         exec { 'bacula-director reload':
15                 path        => '/usr/bin:/usr/sbin:/bin:/sbin',
16                 command     => 'service bacula-director reload',
17                 refreshonly => true,
18         }
19
20
21         file { '/etc/bacula/conf.d':
22                 ensure  => directory,
23                 mode    => '0755',
24                 group   => bacula,
25                 purge   => true,
26                 force   => true,
27                 recurse => true,
28                 source  => 'puppet:///files/empty/',
29                 notify  => Exec['bacula-director reload']
30         }
31
32         file { '/etc/bacula/bacula-dir.conf':
33                 content => template('bacula/bacula-dir.conf.erb'),
34                 mode    => '0440',
35                 group   => bacula,
36                 require => Package['bacula-director-pgsql'],
37                 notify  => Exec['bacula-director reload']
38         }
39
40         @ferm::rule { 'dsa-bacula-dir':
41                 domain      => '(ip)',
42                 description => 'Allow bacula access from localhost',
43                 rule        => "proto tcp mod state state (NEW) dport (bacula-dir) saddr (${bacula_director_ip} localhost) ACCEPT",
44         }
45
46         file { '/etc/bacula/conf.d/empty.conf':
47                 content => '',
48                 mode    => '0440',
49                 group   => bacula,
50                 require => Package['bacula-director-pgsql'],
51                 notify  => Exec['bacula-director reload']
52         }
53
54         Bacula::Node<<| |>>
55
56         package { 'bacula-console':
57                 ensure => installed;
58         }
59
60         file { '/etc/bacula/bconsole.conf':
61                 content => template('bacula/bconsole.conf.erb'),
62                 mode    => '0640',
63                 group   => bacula,
64                 require => Package['bacula-console']
65         }
66 }