our prefix is dsa
[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         file { '/etc/bacula/conf.d':
21                 ensure  => directory,
22                 mode    => '0755',
23                 group   => bacula,
24                 purge   => true,
25                 force   => true,
26                 recurse => true,
27                 source  => 'puppet:///files/empty/',
28                 notify  => Exec['bacula-director reload']
29         }
30
31         file { '/etc/bacula/bacula-dir.conf':
32                 content => template('bacula/bacula-dir.conf.erb'),
33                 mode    => '0440',
34                 group   => bacula,
35                 require => Package['bacula-director-pgsql'],
36                 notify  => Exec['bacula-director reload']
37         }
38
39         @ferm::rule { 'dsa-bacula-dir':
40                 domain      => '(ip)',
41                 description => 'Allow bacula access from localhost',
42                 rule        => "proto tcp mod state state (NEW) dport (bacula-dir) saddr (${bacula_director_ip} localhost) ACCEPT",
43         }
44
45         file { '/etc/bacula/conf.d/empty.conf':
46                 content => '',
47                 mode    => '0440',
48                 group   => bacula,
49                 require => Package['bacula-director-pgsql'],
50                 notify  => Exec['bacula-director reload']
51         }
52
53         Bacula::Node<<| |>>
54
55         package { 'bacula-console':
56                 ensure => installed;
57         }
58
59         file { '/etc/bacula/bconsole.conf':
60                 content => template('bacula/bconsole.conf.erb'),
61                 mode    => '0640',
62                 group   => bacula,
63                 require => Package['bacula-console']
64         }
65
66         file { '/etc/bacula/bacula-volume-purge-action':
67                 mode    => '0555',
68                 source  => 'puppet:///modules/bacula/bacula-volume-purge-action',
69                 ;
70         }
71         file { '/etc/bacula/storages-list.d':
72                 ensure  => directory,
73                 mode    => '0755',
74                 group   => bacula,
75                 purge   => true,
76                 force   => true,
77                 recurse => true,
78                 source  => 'puppet:///files/empty/',
79         }
80         file { "/etc/cron.d/dsa-bacula-stuff":
81                 content => "@daily root (cat /etc/bacula/storages-list.d/*.storage; echo '$bacula::bacula_filestor_name-catalog') | /etc/bacula/bacula-volume-purge-action\n";
82         }
83 }