45b91724cdddb33294628ad57d418b92545a218f
[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 = "/var/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 = 9101 }
24          ip = { addr = <%=@bacula_director_address%>; port = <%=@bacula_director_port%> }
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 # A fileset for the catalog, one sql dump of the db                    #
87 ########################################################################
88 FileSet {
89   Name = "Catalog"
90   Include {
91     Options {
92       signature = SHA1
93       #compression = GZIP9
94     }
95     File = "/var/lib/bacula/bacula.sql.gz"
96   }
97 }
98
99 ########################################################################
100 # The job schedules                                                    #
101 ########################################################################
102
103 # When to do the backups, full backup on first sunday of the month,
104 #  differential (i.e. incremental since full) every other sunday,
105 #  and incremental backups other days
106 Schedule {
107   Name = "WeeklyCycle"
108   # fulls are automatically run if the last full backup was 40 days ago
109   # for the current value of 40 look for "Max Full Interval" in this file.
110   # Run = Full 1st sat at 00:35
111   Run = Differential sat at 00:35
112   Run = Incremental sun-fri at 00:35
113 }
114
115 # This schedule does the catalog. It starts after the WeeklyCycle
116 Schedule {
117   Name = "WeeklyCycleAfterBackup"
118   Run = Full sun-sat at 02:10
119 }
120
121 ########################################################################
122 # Generic catalog service                                              #
123 ########################################################################
124 Catalog {
125   Name = MyCatalog
126   dbname = "service = bacula";
127   #DB Address = "<%= @bacula_db_address %>";
128   #DB Port = <%= @bacula_db_port %>;
129   dbuser = "bacula";
130   dbpassword = "<%= @bacula_db_secret %>"
131 }
132
133 ########################################################################
134 # Message delivery                                                     #
135 ########################################################################
136 Messages {
137   Name = Standard
138   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r"
139   operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"
140   #mail on error = <%= @bacula_operator_email %> = all, !skipped
141   mail = <%= @bacula_operator_email %> = all
142   operator = <%= @bacula_operator_email %> = mount
143   console = all, !skipped, !saved
144   syslog = all
145   append = "/var/lib/bacula/log" = all
146   catalog = all
147 }
148
149 # Message delivery for daemon messages (no job).
150 Messages {
151   Name = Daemon
152   mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r"
153   mail = <%= @bacula_operator_email %> = all
154   console = all, !skipped, !saved
155   syslog = all
156   append = "/var/lib/bacula/log" = all
157 }
158
159 ########################################################################
160 # Console, limited                                                     #
161 ########################################################################
162 Console {
163   Name = <%= @bacula_monitor_name %>
164   Password = "<%= @bacula_monitor_secret %>"
165   CommandACL = status, .status
166 }
167
168 ########################################################################
169 # Jobdefinitions with defaults and stuff                               #
170 ########################################################################
171 JobDefs {
172   Name = "Standardbackup"
173   Type = Backup
174   Level = Incremental
175   FileSet = "Standard Set"
176   Accurate = yes
177   # Schedule = "WeeklyCycle"
178   Messages = Standard
179   Max Full Interval = 50 days
180   Priority = 10
181   Write Bootstrap = "/var/lib/bacula/%c.bsr"
182   Maximum Concurrent Jobs = 20
183   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"
184 }
185
186 ########################################################################
187 # Standard Restore template, to be changed by Console program          #
188 #  Only one such job is needed for all Jobs/Clients/Storage ...        #
189 ########################################################################
190 Job {
191   Name = "RestoreFiles"
192   Type = Restore
193   Client = <%=@bacula_director_address%>-fd
194   FileSet = "Standard Set"
195   Pool = poolfull-<%=@bacula_pool_name%>-<%=@bacula_director_address%>
196   Messages = Standard
197   Where = /var/tmp/bacula-restores
198 }
199
200
201 # Scratch pool definition
202 Pool {
203   Name = Scratch
204   Pool Type = Backup
205 }
206
207 ########################################################################
208 # Generic jobs                                                         #
209 ########################################################################
210 # Backup the catalog database (after the nightly save)
211 Storage {
212   Name = "<%= @bacula_filestor_name %>-catalog"
213   Address = <%= @bacula_storage_address %>
214   SDPort = <%= @bacula_storage_port %>
215   Password = "<%= @bacula_storage_secret %>"
216   Device = "<%= @bacula_filestor_device %>-catalog"
217   Media Type = "<%= @bacula_filestor_name %>-catalog"
218   Maximum Concurrent Jobs = 10
219
220   TLS Enable = yes
221   TLS Require = yes
222   TLS CA Certificate File = "<%= @bacula_ca_path %>"
223   # This is a client certificate, used by the director to connect to the storage daemon
224   TLS Certificate = "<%= @bacula_ssl_client_cert %>"
225   TLS Key = "<%= @bacula_ssl_client_key %>"
226 }
227 Pool {
228   Name = "poolcatalog-<%=@bacula_pool_name%>"
229   Pool Type = Backup
230   Storage = "<%=@bacula_filestor_name%>-catalog"
231   AutoPrune = yes
232   Volume Retention = 2 months
233   Label Format = "<%= @bacula_pool_name %>-catalog.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
234   Volume Use Duration = 23h
235   Maximum Volume Jobs = 1
236   Maximum Volume Bytes = 500G
237   Action On Purge = Truncate
238   Recycle = yes
239   RecyclePool = "poolcataloggraveyard-<%=@bacula_pool_name%>"
240 }
241 Pool {
242   Name = "poolcataloggraveyard-<%=@bacula_pool_name%>"
243   Pool Type = Backup
244   Storage = "<%=@bacula_filestor_name%>-catalog"
245   Recycle = yes
246   RecyclePool = "poolcataloggraveyard-<%=@bacula_pool_name%>"
247 }
248
249 Job {
250   Name = "BackupCatalog"
251   JobDefs = "Standardbackup"
252   Client = <%=@bacula_director_address%>-fd
253   Level = Full
254   FileSet = "Catalog"
255   Schedule = "WeeklyCycleAfterBackup"
256 #  # This creates an ASCII copy of the catalog
257 #  # Arguments to make_catalog_backup.pl are:
258 #  #  make_catalog_backup.pl <catalog-name>
259   RunBeforeJob = "/etc/bacula/scripts/make_catalog_backup.pl MyCatalog"
260 #  # This deletes the copy of the catalog
261   RunAfterJob  = "/etc/bacula/scripts/delete_catalog_backup"
262   Write Bootstrap = "/var/lib/bacula/%n.bsr"
263   Priority = 15    # run after main backup
264   Pool = "poolcatalog-<%=@bacula_pool_name%>"
265 }
266
267 ########################################################################
268 # And now include all the generated configs                            #
269 ########################################################################
270 @|"sh -c 'for f in /etc/bacula/conf.d/*.conf ; do echo @${f} ; done'"