Make bacula_director_port something local to the director class
[mirror/dsa-puppet.git] / modules / bacula / templates / bacula-dir.conf.erb
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
4 ##
5 ##
6 #  For Bacula release 5.0.1 (24 February 2010) -- debian 5.0.4
7
8 ########################################################################
9 # Bacula Director itself                                               #
10 ########################################################################
11
12 Director {
13   Name = <%= @bacula_director_name %>
14   Description = <%= @hostname %> - <%= @domain %> Bacula Director
15   QueryFile = "/etc/bacula/scripts/query.sql"
16   WorkingDirectory = "/var/lib/bacula"
17   PidDirectory = "/run/bacula"
18   Maximum Concurrent Jobs = 20
19   Password = "<%= @bacula_director_secret %>"
20   Messages = Daemon
21   DirAddresses = {
22      # Always have localhost in, then the configured IP
23      ip = { addr = 127.0.0.1; port = <%= @port_dir %> }
24      ip = { addr = <%=@bacula_director_address%>; port = <%= @port_dir %> }
25   }
26
27   TLS Enable = yes
28   TLS Require = yes
29   TLS Verify Peer = yes
30   TLS Allowed CN = "clientcerts/<%= @bacula_director_address %>"
31   TLS CA Certificate File = "<%= @bacula_ca_path %>"
32   # This is a server certificate, used for incoming console connections.
33   TLS Certificate = "<%= @bacula_ssl_server_cert %>"
34   TLS Key = "<%= @bacula_ssl_server_key %>"
35
36   Heartbeat Interval = 60
37 }
38
39 ########################################################################
40 # Standard Fileset                                                     #
41 ########################################################################
42 FileSet {
43   Name = "Standard Set"
44   Ignore FileSet Changes = yes
45   Include {
46     Options {
47       signature = SHA1
48       compression = GZIP9
49       aclsupport = yes
50       xattrsupport = yes
51     }
52     Options {
53       wild = "/swapfile*"
54       exclude = yes
55     }
56     File = "\\|/usr/local/sbin/bacula-backup-dirs"
57     # Dont backup directories that contain .nobackup files
58     Exclude Dir Containing = .nobackup
59   }
60
61   Exclude {
62     File = /.fsck
63     File = /.journal
64     File = /dev
65     File = /home/buildd/build-trees
66     File = /lib/init/rw
67     File = /nonexistant
68     File = /proc
69     File = /srv/chroot
70     File = /sys
71     File = /tmp
72     File = /srv/apache-cache/mod_cache_disk
73     File = /var/cache/apache2/mod_cache_disk
74     File = /var/cache/apt
75     File = /var/lib/apt
76     File = /var/lib/bacula
77     File = /var/lib/munin-async
78     File = /var/lock
79     File = /var/log/samhain
80     File = /var/run
81     File = "\\|bash -c 'grep -s -v ^# /etc/bacula/local-exclude || true'"
82   }
83 }
84
85
86 ########################################################################
87 # Generic catalog service                                              #
88 ########################################################################
89 Catalog {
90   Name = MyCatalog
91   dbname = <%= @db_name %>;
92   dbport = <%= @db_port %>;
93   dbaddress = "<%= @db_address %>";
94   dbsslmode = verify-ca;
95 <% if @db_sslca %>
96   dbsslca = "<%= @db_sslca %>";
97 <% end %>
98   dbuser = "<%= @db_user %>";
99   dbpassword = "<%= @bacula_db_secret %>"
100 }
101
102 ########################################################################
103 # Message delivery                                                     #
104 ########################################################################
105 Messages {
106   Name = Standard
107   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
108   operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
109   #mail on error = <%= @bacula_operator_email %> = all, !skipped
110   mail = <%= @bacula_operator_email %> = all
111   operator = <%= @bacula_operator_email %> = mount
112   console = all, !skipped, !saved
113   syslog = all
114   append = "/var/lib/bacula/log" = all
115   catalog = all
116 }
117
118 # Message delivery for daemon messages (no job).
119 Messages {
120   Name = Daemon
121   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
122   mail = <%= @bacula_operator_email %> = all
123   console = all, !skipped, !saved
124   syslog = all
125   append = "/var/lib/bacula/log" = all
126 }
127
128 ########################################################################
129 # Console, limited                                                     #
130 ########################################################################
131 Console {
132   Name = <%= @bacula_monitor_name %>
133   Password = "<%= @bacula_monitor_secret %>"
134   CommandACL = status, .status
135 }
136
137 ########################################################################
138 # Jobdefinitions with defaults and stuff                               #
139 ########################################################################
140 JobDefs {
141   Name = "Standardbackup"
142   Type = Backup
143   Level = Incremental
144   FileSet = "Standard Set"
145   Accurate = yes
146   Messages = Standard
147   Max Full Interval = 50 days
148   Priority = 10
149   Write Bootstrap = "/var/lib/bacula/%c.bsr"
150   Maximum Concurrent Jobs = 20
151   Client Run After Job = "/usr/local/sbin/postbaculajob -c \"%c\" -d \"%d\" -i \"%i\" -l \"%l\" -n \"%n\" -o /var/log/bacula/client-after.state"
152 }
153
154 ########################################################################
155 # Standard Restore template, to be changed by Console program          #
156 #  Only one such job is needed for all Jobs/Clients/Storage ...        #
157 ########################################################################
158 Job {
159   Name = "RestoreFiles"
160   Type = Restore
161   Client = <%=@bacula_director_address%>-fd
162   FileSet = "Standard Set"
163   Pool = <%= @some_pool_name %>
164   Messages = Standard
165   Where = /var/tmp/bacula-restores
166 }
167
168
169 # Scratch pool definition
170 Pool {
171   Name = Scratch
172   Pool Type = Backup
173 }
174
175 ########################################################################
176 # And now include all the generated configs                            #
177 ########################################################################
178 @|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"