]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/manifests/director.pp
58c143d2d36adcd0c7a7f7caf084bc69be23a40d
[dsa-puppet.git] / modules / bacula / manifests / director.pp
1 class bacula::director inherits bacula {
2
3   package {
4     "bacula-director-pgsql": ensure => installed;
5     "bacula-common": ensure => installed;
6     "bacula-common-pgsql": ensure => installed;
7   }
8
9   service {
10     "bacula-director":
11       ensure => running,
12       enable => true,
13       hasstatus => true,
14       require => Package["bacula-director-pgsql"];
15   }
16   file {
17     "/etc/bacula/conf.d":
18       ensure  => directory,
19       mode => 755,
20       group => bacula,
21       purge => true,
22       notify  => Exec["bacula-director restart"]
23       ;
24     "/etc/bacula/bacula-dir.conf":
25       content => template("bacula/bacula-dir.conf.erb"),
26       mode => 440,
27       group => bacula,
28       require => Package["bacula-director-pgsql"],
29       notify  => Exec["bacula-director restart"]
30       ;
31   }
32
33   exec {
34     "bacula-director restart":
35       path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
36       refreshonly => true;
37   }
38
39   define bacula_client() {
40     # These must be kept in sync with the settings in bacula.pp
41     $bacula_client_name       = "${name}-fd"
42     $bacula_client_secret     = hmac("/etc/puppet/secret", "bacula-fd-${name}")
43     $client = $name
44
45     file {
46       "/etc/bacula/conf.d/${name}.conf":
47       content => template("bacula/per-client.conf.erb"),
48       mode => 440,
49       group => bacula,
50       notify  => Exec["bacula-director restart"]
51       ;
52     }
53   }
54 #  $allhosts = keys($site::allnodeinfo)
55   $allhosts = [ "berlioz.debian.org", "biber.debian.org", "draghi.debian.org" ]
56   bacula_client { $allhosts: }
57
58   @ferm::rule { 'dsa-bacula-dir':
59     domain      => '(ip ip6)',
60     description => 'Allow bacula access from localhost',
61     rule        => "proto tcp mod state state (NEW) dport (bacula-dir) saddr (${bacula_director_address} localhost) ACCEPT",
62   }
63
64 }