]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/manifests/director.pp
Use $name rather than $client, syntax, syntax, syntax
[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       notify  => Exec["bacula-director restart"]
22       ;
23     "/etc/bacula/bacula-dir.conf":
24       content => template("bacula/bacula-dir.conf.erb"),
25       mode => 440,
26       group => bacula,
27       require => Package["bacula-director-pgsql"],
28       notify  => Exec["bacula-director restart"]
29       ;
30   }
31
32   exec {
33     "bacula-director restart":
34       path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
35       refreshonly => true;
36   }
37
38   define bacula_client() {
39     # These must be kept in sync with the settings in bacula.pp
40     $bacula_client_name       = "${name}-fd"
41     $bacula_client_secret     = hmac("/etc/puppet/secret", "bacula-fd-${name}")
42
43     file {
44       "/etc/bacula/conf.d/${name}.conf":
45       content => template("bacula/per-client.conf.erb"),
46       mode => 440,
47       group => bacula,
48       notify  => Exec["bacula-director restart"]
49       ;
50     }
51   }
52   $allhosts = keys($site::allnodeinfo)
53
54   bacula_client { $allhosts: }
55 }