rename get-deleteable-volumes -> volumes-delete-old
[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         package { 'python3-psycopg2': ensure => installed }
67         file { '/etc/bacula/scripts/volume-purge-action':
68                 mode    => '0555',
69                 source  => 'puppet:///modules/bacula/volume-purge-action',
70                 ;
71         }
72         file { '/etc/bacula/scripts/volumes-delete-old':
73                 mode    => '0555',
74                 source  => 'puppet:///modules/bacula/volumes-delete-old',
75                 ;
76         }
77         file { '/etc/bacula/storages-list.d':
78                 ensure  => directory,
79                 mode    => '0755',
80                 group   => bacula,
81                 purge   => true,
82                 force   => true,
83                 recurse => true,
84                 source  => 'puppet:///files/empty/',
85         }
86         file { "/etc/cron.d/puppet-bacula-stuff":
87                 content => "@daily root chronic /etc/bacula/scripts/volume-purge-action -v\n";
88         }
89 }