diff --git a/manifests/client/config.pp b/manifests/client/config.pp
index 36b1a8a..cf1d8c9 100644
--- a/manifests/client/config.pp
+++ b/manifests/client/config.pp
@@ -104,6 +104,7 @@
$ensure = file,
$backup_enable = 'yes',
$client_schedule = 'WeeklyCycle',
+ $jobdefs = undef,
$db_backend = undef,
$director_password = '',
$director_server = undef,
@@ -122,6 +123,7 @@
$tls_ca_cert_dir = undef,
$tls_require = 'yes',
$use_tls = false,
+ $bootstrap = "/var/lib/bacula/${name}.bsr",
) {
include ::bacula::params
@@ -193,7 +195,7 @@
}
if $run_scripts {
- case type($run_scripts) {
+ case type3x($run_scripts) {
'array' : {
# TODO figure out how to validate each item in the array is a hash.
$run_scripts_real = $run_scripts
diff --git a/manifests/client/job.pp b/manifests/client/job.pp
new file mode 100644
index 0000000..53ce489
--- /dev/null
+++ b/manifests/client/job.pp
@@ -0,0 +1,32 @@
+define bacula::client::job (
+ $client = $name,
+ $type = Backup,
+ $backup_enable = 'yes',
+ $restore_enable = 'yes',
+ $storage_server_real = undef,
+ $client_schedule = undef,
+ $director_password = '',
+ $director_server_real = undef,
+ $fileset = 'Basic:noHome',
+ $run_scripts_real = undef,
+ $storage_server = undef,
+ $pool = 'default',
+ $rerun_failed_levels = undef,
+ $restore_where = '/var/tmp/bacula-restores',
+ $volume_autoprune = 'Yes',
+ $volume_retention = '1 Year',
+ $restore_where = undef,
+ $bootstrap = undef,
+) {
+
+ file { "/etc/bacula/bacula-dir.d/jobs-${name}.conf":
+ ensure => file,
+ owner => 'bacula',
+ group => 'bacula',
+ mode => '0640',
+ content => template('bacula/job.erb'),
+ notify => Exec['bacula-dir reload'],
+ }
+
+}
+
diff --git a/manifests/director.pp b/manifests/director.pp
index dedaf38..af9d374 100644
--- a/manifests/director.pp
+++ b/manifests/director.pp
@@ -62,6 +62,7 @@
$use_tls = false,
$use_vol_purge_script = false,
$use_vol_purge_mvdir = undef,
+ $volume_recycle = 'No',
$volume_autoprune = 'Yes',
$volume_autoprune_diff = 'Yes',
$volume_autoprune_full = 'Yes',
@@ -73,6 +74,9 @@
) inherits ::bacula::params {
+ $scripts_dir = $::bacula::params::scripts_dir
+ $catalog_dir = $::bacula::params::catalog_dir
+
$director_server_real = $director_server ? {
undef => $::bacula::params::director_server_default,
default => $director_server,
@@ -258,10 +262,15 @@
require => $service_require,
}
+ $bconsole_cmd = $::osfamily ? {
+ 'Debian' => '/usr/bin/bconsole',
+ default => '/usr/sbin/bconsole',
+ }
+
# Instead of restarting the bacula-dir service which could interrupt running jobs tell the director to reload its
# configuration.
exec { 'bacula-dir reload':
- command => '/bin/echo reload | /usr/sbin/bconsole',
+ command => "/bin/echo reload | ${bconsole_cmd}",
logoutput => on_failure,
refreshonly => true,
timeout => 10,
@@ -270,4 +279,13 @@
Service['bacula-dir'],
],
}
+
+
+ concat { "/etc/bacula/bacula-dir.d/pools.conf":
+ owner => 'bacula',
+ group => 'tape',
+ mode => '0644',
+ }
+
+
}
diff --git a/manifests/director/custom_config.pp b/manifests/director/custom_config.pp
index 41d0395..ef75b18 100644
--- a/manifests/director/custom_config.pp
+++ b/manifests/director/custom_config.pp
@@ -28,7 +28,8 @@
$ensure = 'file',
$director_server = undef,
$content = undef,
- $source = undef
+ $source = undef,
+ $subdir = 'bacula-dir.d',
) {
if !($ensure in ['file', 'absent']) {
fail('The only valid values for the ensure parameter are file or absent')
@@ -40,7 +41,7 @@
fail('You must supply either the content or source parameter')
}
- file { "/etc/bacula/bacula-dir.d/custom-${name}.conf":
+ file { "/etc/bacula/${subdir}/custom-${name}.conf":
ensure => file,
owner => 'bacula',
group => 'bacula',
diff --git a/manifests/director/mysql.pp b/manifests/director/mysql.pp
index 64607c9..c808f96 100644
--- a/manifests/director/mysql.pp
+++ b/manifests/director/mysql.pp
@@ -32,8 +32,8 @@
$db_port = '3306',
$db_user = '',
$db_user_host = undef,
- $manage_db = false,
-) {
+ $manage_db = false
+){
include ::bacula::params
if $manage_db {
@@ -47,7 +47,12 @@
$db_require = Class['::mysql::server']
}
} else {
- $db_require = undef
+ if defined(Class['percona']) {
+ $db_require = Class['percona']
+ $is_percona = true
+ } else {
+ $db_require = undef
+ }
}
$db_user_host_real = $db_user_host ? {
@@ -55,26 +60,36 @@
default => $db_user_host,
}
- #FIXME Due to a bug in v1.0.0 of the puppetlabs-mysql module I can't use a notify here on the define.
- mysql::db { $db_database:
- user => $db_user,
- password => $db_password,
- host => $db_user_host,
- grant => ['all'],
- require => $db_require,
- # notify => Exec['make_db_tables'],
- before => Exec['make_db_tables'],
+ if $is_percona {
+ percona::database { $db_database:
+ ensure => present,
+ notify => Exec['make_db_tables'],
+ }
+
+ percona::rights { "${db_user}@${db_user_host}/${db_database}":
+ database => $db_database,
+ priv => [ 'all' ],
+ host => $db_user_host,
+ password => $db_password,
+ }
+ } else {
+ mysql::db { $db_database:
+ user => $db_user,
+ password => $db_password,
+ host => $db_user_host,
+ grant => ['all'],
+ require => $db_require,
+ notify => Exec['make_db_tables'],
+ }
}
- #FIXME Work around a bug in v1.0.0 of the puppetlabs-mysql module that causes the mysql_grant type to notify on
- # every run by having the mysql_database resource created in the mysql::db define notify
- # Exec['make_db_tables'] instead of using the more flexible notify from the entire define.
- Mysql_database[$db_database] ~> Exec['make_db_tables']
}
$make_db_tables_command = $::operatingsystem ? {
- /(Ubuntu|Debian)/ => '/usr/lib/bacula/make_bacula_tables',
- default => '/usr/libexec/bacula/make_mysql_tables',
+ 'Debian' => '/usr/lib/bacula/make_bacula_tables',
+ 'Ubuntu' => '/usr/share/bacula-director/make_mysql_tables',
+ default => '/usr/libexec/bacula/make_mysql_tables',
}
+
$db_parameters = "--host=${db_host} --user=${db_user} --password=${db_password} --port=${db_port} --database=${db_database}"
exec { 'make_db_tables':
diff --git a/manifests/director/pool.pp b/manifests/director/pool.pp
new file mode 100644
index 0000000..fe6d828
--- /dev/null
+++ b/manifests/director/pool.pp
@@ -0,0 +1,40 @@
+# == Define: bacula::director::pool
+#
+# Include a pool configuration file in /etc/bacula/bacula-dir.d/pools.conf.
+#
+# === Parameters
+#
+# === Examples
+#
+# Provide some examples on how to use this type:
+#
+# bacula::director::pool { 'namevar' :
+# label_ext => full,
+# }
+#
+define bacula::director::pool (
+ $pool_type = 'Backup',
+ $label_format = '${Client}.${Year}${Month:p/2/0/r}${Day:p/2/0/r}.${Hour:p/2/0/r}${Minute:p/2/0/r}',
+ $label_ext = undef,
+ $recycle = 'Yes',
+ $auto_prune = 'Yes',
+ $volume_retention = '1 Week',
+ $max_volume_bytes = '100G',
+ $max_volume_jobs = 20,
+ $subdir = 'bacula-dir.d',
+) {
+ if $label_ext == '' {
+ $fin_label_format = "${label_format}"
+ } else {
+ $fin_label_format = "${label_format}.${label_ext}"
+ }
+
+ concat::fragment { "${name}":
+ ensure => present,
+ target => "/etc/bacula/${subdir}/pools.conf",
+ content => template('bacula/pool.erb'),
+ }
+
+
+
+}
diff --git a/manifests/init.pp b/manifests/init.pp
index f3b6732..29c35bc 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -225,7 +225,7 @@
$manage_db_tables = true,
$manage_logwatch = undef,
$operator_command = $::bacula::params::operator_command,
- $plugin_dir = undef,
+ $plugin_dir = $::bacula::params::plugin_dir,
$storage_default_mount = '/mnt/bacula',
$storage_server = undef,
$storage_template = undef,
@@ -240,6 +240,7 @@
$use_tls = false,
$use_vol_purge_script = false,
$use_vol_purge_mvdir = undef,
+ $volume_recycle = 'No',
$volume_autoprune = 'Yes',
$volume_autoprune_diff = 'Yes',
$volume_autoprune_full = 'Yes',
@@ -309,6 +310,7 @@
use_tls => $use_tls,
use_vol_purge_script => $use_vol_purge_script,
use_vol_purge_mvdir => $use_vol_purge_mvdir,
+ volume_recycle => $volume_recycle,
volume_autoprune => $volume_autoprune,
volume_autoprune_diff => $volume_autoprune_diff,
volume_autoprune_full => $volume_autoprune_full,
@@ -370,6 +372,7 @@
use_tls => $use_tls,
use_vol_purge_script => $use_vol_purge_script,
use_vol_purge_mvdir => $use_vol_purge_mvdir,
+ volume_recycle => $volume_recycle,
volume_autoprune => $volume_autoprune,
volume_autoprune_diff => $volume_autoprune_diff,
volume_autoprune_full => $volume_autoprune_full,
diff --git a/manifests/params.pp b/manifests/params.pp
index 2eb3899..f8969c8 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -49,7 +49,7 @@
x86_64 => 'lib64',
default => 'lib',
}
- $libdir = $::operatingsystem ? {
+ $libdir = $facts['os']['family'] ? {
/(Debian|Ubuntu)/ => '/usr/lib',
default => "/usr/${lib}",
}
@@ -74,4 +74,16 @@
/(Debian|Ubuntu)/ => 'bacula-sd-sqlite',
default => 'bacula-storage-sqlite',
}
+
+ case $::operatingsystem {
+ /(Ubuntu)/: {
+ $scripts_dir = '/etc/bacula/scripts'
+ $catalog_dir = '/var/lib/bacula'
+ }
+ default: {
+ $scripts_dir = '/usr/libexec/bacula'
+ $catalog_dir = '/var/spool/bacula'
+ }
+ }
+
}
diff --git a/manifests/params/validate.pp b/manifests/params/validate.pp
index e140ea8..4883a24 100644
--- a/manifests/params/validate.pp
+++ b/manifests/params/validate.pp
@@ -61,6 +61,7 @@
$use_tls = '',
$use_vol_purge_script = false,
$use_vol_purge_mvdir = undef,
+ $volume_recycle = '',
$volume_autoprune = '',
$volume_autoprune_diff = '',
$volume_autoprune_full = '',
@@ -95,18 +96,18 @@
validate_re($volume_autoprune_incr, '^(Yes|yes|No|no)$')
# Validate mail_to variables are email address
- if $mail_to != undef {
+ if $mail_to != '' {
validate_re($mail_to, '^[\w-]+@([\w-]+\.)+[\w-]+$')
- } elsif $mail_to == undef and $mail_to_on_error == undef {
+ } elsif $mail_to == '' and $mail_to_on_error == '' {
validate_re($::bacula::params::mail_to_default, '^[\w-]+@([\w-]+\.)+[\w-]+$')
}
- if $mail_to_daemon != undef {
+ if $mail_to_daemon != '' {
validate_re($mail_to_daemon, '^[\w-]+@([\w-]+\.)+[\w-]+$')
}
- if $mail_to_on_error != undef {
+ if $mail_to_on_error != '' {
validate_re($mail_to_on_error, '^[\w-]+@([\w-]+\.)+[\w-]+$')
}
- if $mail_to_operator != undef {
+ if $mail_to_operator != '' {
validate_re($mail_to_operator, '^[\w-]+@([\w-]+\.)+[\w-]+$')
}
validate_bool($use_vol_purge_script)
@@ -179,7 +180,7 @@
validate_absolute_path($storage_default_mount)
- if $plugin_dir != undef {
+ if $plugin_dir != '' {
validate_absolute_path($plugin_dir)
}
diff --git a/manifests/storage.pp b/manifests/storage.pp
index 1d101bc..8d5824a 100644
--- a/manifests/storage.pp
+++ b/manifests/storage.pp
@@ -84,7 +84,7 @@
ensure => directory,
owner => 'bacula',
group => 'bacula',
- mode => '0755',
+ mode => '0770',
require => Package[$db_package],
}
diff --git a/templates/bacula-dir.conf.erb b/templates/bacula-dir.conf.erb
index 383b911..c53e7ee 100644
--- a/templates/bacula-dir.conf.erb
+++ b/templates/bacula-dir.conf.erb
@@ -13,7 +13,7 @@ Director {
<% if @plugin_dir -%>
Plugin Directory = <%= @plugin_dir %>
<% end -%>
- Maximum Concurrent Jobs = 5
+ Maximum Concurrent Jobs = 20
Password = "<%= @director_password -%>"
Messages = "<%= @director_server_real -%>:messages:daemon"
<% if @use_tls -%>
@@ -95,6 +95,7 @@ Storage {
Password = "<%= @director_password -%>"
Device = "DefaultFileStorage"
Media Type = File
+ Maximum Concurrent Jobs = 20
<% if @use_tls -%>
TLS Enable = yes
TLS Require = <%= @tls_require %>
@@ -120,12 +121,13 @@ Pool {
# theory the same time period for weekly backups from the clients)
# Note the files for the old volumes will still remain on the disk but will
# be truncated to a zero size.
- Recycle = No
+ Recycle = <%= @volume_recycle %>
Auto Prune = <%= @volume_autoprune %>
Action On Purge = Truncate
Volume Retention = <%= @volume_retention %>
# Don't allow re-use of volumes; one volume per job only
- Maximum Volume Jobs = 1
+ Maximum Volume Bytes = 100G
+ Maximum Volume Jobs = 20
}
Pool {
Name = "<%= @storage_server_real -%>:pool:default.full"
@@ -137,12 +139,13 @@ Pool {
# Clean up any we don't need, and keep them for a maximum of a year
# Note the files for the old volumes will still remain on the disk but will
# be truncated to a zero size.
- Recycle = No
+ Recycle = <%= @volume_recycle %>
Auto Prune = <%= @volume_autoprune_full %>
Action On Purge = Truncate
Volume Retention = <%= @volume_retention_full %>
# Don't allow re-use of volumes; one volume per job only
- Maximum Volume Jobs = 1
+ Maximum Volume Bytes = 100G
+ Maximum Volume Jobs = 20
}
Pool {
@@ -155,12 +158,13 @@ Pool {
# Clean up any we don't need, and keep them for a maximum of fourty days
# Note the files for the old volumes will still remain on the disk but will
# be truncated to a zero size.
- Recycle = No
+ Recycle = <%= @volume_recycle %>
Auto Prune = <%= @volume_autoprune_diff %>
Action On Purge = Truncate
Volume Retention = <%= @volume_retention_diff %>
# Don't allow re-use of volumes; one volume per job only
- Maximum Volume Jobs = 1
+ Maximum Volume Bytes = 100G
+ Maximum Volume Jobs = 20
}
Pool {
@@ -173,12 +177,13 @@ Pool {
# Clean up any we don't need, and keep them for a maximum of 40 days
# Note the files for the old volumes will still remain on the disk but will
# be truncated to a zero size.
- Recycle = No
+ Recycle = <%= @volume_recycle %>
Auto Prune = <%= @volume_autoprune_incr %>
Action On Purge = Truncate
Volume Retention = <%= @volume_retention_incr %>
# Don't allow re-use of volumes; one volume per job only
- Maximum Volume Jobs = 1
+ Maximum Volume Bytes = 100G
+ Maximum Volume Jobs = 20
}
Pool {
@@ -195,14 +200,14 @@ Pool {
# we should keep at least one weeks worth of backups of the database
Volume Retention = 1 Week
# Don't allow re-use of volumes; one volume per job only
- Maximum Volume Jobs = 1
+ Maximum Volume Jobs = 20
}
# Create a Counter which will be used to label the catalog volumes on the system
Counter {
- Name = "Counter<%= @director_server_real.split('.')[0].capitalize -%>Catalog"
+ Name = "Counter<%= director_server_real.split('.')[0].capitalize -%>Catalog"
Minimum = 1
- Catalog = "<%= @director_server_real -%>:<%= @db_backend %>"
+ Catalog = "<%= director_server_real -%>:<%= db_backend %>"
}
# FILE SETS -------------------------------------------------------------------
@@ -296,7 +301,7 @@ FileSet {
Signature = SHA1
Compression = GZIP
}
- File = "/var/spool/bacula/bacula.sql"
+ File = "<%= @catalog_dir %>/bacula.sql"
}
}
@@ -391,10 +396,11 @@ Job {
Messages = "<%= @director_server_real -%>:messages:standard"
Pool = "<%= @storage_server_real -%>:pool:catalog"
# This creates an ASCII copy of the catalog
- RunBeforeJob = "/usr/libexec/bacula/make_catalog_backup.pl <%= @director_server_real -%>:<%= @db_backend -%>"
+ RunBeforeJob = "<%= @scripts_dir -%>/make_catalog_backup.pl <%= director_server_real -%>:<%= db_backend -%>"
# This deletes the copy of the catalog
- RunAfterJob = "/usr/libexec/bacula/delete_catalog_backup"
+ RunAfterJob = "<%= @scripts_dir -%>/delete_catalog_backup"
Write Bootstrap = "/var/lib/bacula/BackupCatalog.bsr"
+ Maximum Concurrent Jobs = 20
# Run after main backup
Priority = 50
<% if @use_vol_purge_script -%>
diff --git a/templates/bacula-fd.conf.erb b/templates/bacula-fd.conf.erb
index 4114d0c..6afa8c5 100644
--- a/templates/bacula-fd.conf.erb
+++ b/templates/bacula-fd.conf.erb
@@ -36,7 +36,7 @@ FileDaemon {
Plugin Directory = <%= @plugin_dir %>
<% end -%>
PID Directory = /var/run/bacula
- Maximum Concurrent Jobs = 3
+ Maximum Concurrent Jobs = 20
<% if @use_tls -%>
TLS Enable = yes
TLS Require = <%= @tls_require %>
diff --git a/templates/client_config.erb b/templates/client_config.erb
index 67e9552..ac0156b 100644
--- a/templates/client_config.erb
+++ b/templates/client_config.erb
@@ -4,8 +4,9 @@ Client {
Password = "<%= @director_password_real %>"
Catalog = "<%= @director_server_real %>:<%= @db_backend_real %>"
File Retention = 6 Weeks
- Job Retention = 1 Year
+ Job Retention = 6 Weeks
Auto Prune = Yes
+ Maximum Concurrent Jobs = 20
<% if @use_tls -%>
TLS Enable = Yes
TLS Require = <%= @tls_require %>
@@ -23,24 +24,30 @@ Job {
Client = "<%= @name %>"
Type = Backup
Enabled = "<%= @backup_enable %>"
+<% if @jobdefs -%>
+ JobDefs = "DefaultJob"
+<%- end -%>
<%- if @priority -%>
Priority = <%= @priority %>
<%- end -%>
FileSet = "<%= @fileset %>"
- Storage = "<%= @storage_server_real %>:storage:<%= @pool %>"
+ Storage = "<%= @storage_server_real %>:storage:default"
Schedule = "<%= @client_schedule %>"
- Pool = "<%= @storage_server_real %>:pool:<%= @pool %>"
+ Pool = "<%= @pool %>"
<%- if @pool_full_real -%>
- Full Backup Pool = "<%= @storage_server_real %>:pool:<%= @pool_full_real %>"
+ Full Backup Pool = "<%= @pool_full_real %>"
<%- end -%>
<%- if @pool_incr_real -%>
- Incremental Backup Pool = "<%= @storage_server_real %>:pool:<%= @pool_incr_real %>"
+ Incremental Backup Pool = "<%= @pool_incr_real %>"
<%- end -%>
<%- if @pool_diff_real -%>
- Differential Backup Pool = "<%= @storage_server_real %>:pool:<%= @pool_diff_real %>"
+ Differential Backup Pool = "<%= @pool_diff_real %>"
<%- end -%>
Messages = "<%= @director_server_real %>:messages:standard"
Rerun Failed Levels = <%= @rerun_failed_levels %>
+ <%- if @bootstrap -%>
+ Write Bootstrap = "<%= @bootstrap %>"
+ <%- end -%>
<% if @run_scripts_real -%>
<%- @run_scripts_real.each do |runscript| -%>
RunScript {
@@ -74,8 +81,11 @@ Job {
Type = Restore
Enabled = "<%= @restore_enable %>"
FileSet = "<%= @fileset %>"
- Storage = "<%= @storage_server_real %>:storage:<%= @pool %>"
- Pool = "<%= @storage_server_real %>:pool:<%= @pool %>"
+ Storage = "<%= @storage_server_real %>:storage:default"
+ Pool = "<%= @pool %>"
Messages = "<%= @director_server_real %>:messages:standard"
Where = <%= @restore_where %>
+ <%- if @bootstrap -%>
+ Bootstrap = "<%= @bootstrap %>"
+ <%- end -%>
}
diff --git a/templates/fileset.conf.erb b/templates/fileset.conf.erb
index bc13f3d..32be0f7 100644
--- a/templates/fileset.conf.erb
+++ b/templates/fileset.conf.erb
@@ -6,9 +6,14 @@ FileSet {
Compression = GZIP
}
+<% if @include_files.kind_of? Array -%>
<% include_files.each do |file_include| -%>
File = <%= file_include %>
<% end -%>
+<% else -%>
+ File = <%= include_files %>
+<% end -%>
+
}
<% if @exclude_files -%>
diff --git a/templates/job.erb b/templates/job.erb
new file mode 100644
index 0000000..dcba00f
--- /dev/null
+++ b/templates/job.erb
@@ -0,0 +1,63 @@
+Job {
+ Name = "<%= @name %>"
+ Client = "<%= @client %>"
+ Type = <%= @type %>
+ Enabled = "<%= @backup_enable %>"
+<%- if @priority -%>
+ Priority = <%= @priority %>
+<%- end -%>
+ FileSet = "<%= @fileset %>"
+ Storage = "<%= @storage_server_real %>:storage:<%= @pool %>"
+<%- if @client_schedule -%>
+ Schedule = "<%= @client_schedule %>"
+<%- end -%>
+ Pool = "<%= @storage_server_real %>:pool:<%= @pool %>"
+ <%- if @pool_full_real -%>
+ Full Backup Pool = "<%= @storage_server_real %>:pool:<%= @pool_full_real %>"
+ <%- end -%>
+ <%- if @pool_incr_real -%>
+ Incremental Backup Pool = "<%= @storage_server_real %>:pool:<%= @pool_incr_real %>"
+ <%- end -%>
+ <%- if @pool_diff_real -%>
+ Differential Backup Pool = "<%= @storage_server_real %>:pool:<%= @pool_diff_real %>"
+ <%- end -%>
+ Messages = "<%= @director_server_real %>:messages:standard"
+<% if @rerun_failed_levels -%>
+ Rerun Failed Levels = <%= @rerun_failed_levels %>
+<% end -%>
+<% if @bootstrap -%>
+<% if @type == "Backup" -%>
+ Write Bootstrap = "<%= @bootstrap %>"
+<% else -%>
+Bootstrap = "<%= @bootstrap %>"
+<% end -%>
+<% end -%>
+<% if @restore_where -%>
+ Where = <%= @restore_where %>
+<% end -%>
+<% if @run_scripts_real -%>
+ <%- @run_scripts_real.each do |runscript| -%>
+ RunScript {
+ RunsWhen = <%= runscript['RunsWhen'] %>
+ <%- if runscript['RunsOnSuccess'] -%>
+ RunsOnSuccess = <%= runscript['RunsOnSuccess'] %>
+ <%- end -%>
+ <%- if runscript['RunsOnFailure'] -%>
+ RunsOnFailure = <%= runscript['RunsOnFailure'] %>
+ <%- end -%>
+ <%- if runscript['RunsOnClient'] -%>
+ RunsOnClient = <%= runscript['RunsOnClient'] %>
+ <%- end -%>
+ <%- if runscript['FailJobOnError'] -%>
+ FailJobOnError = <%= runscript['FailJobOnError'] %>
+ <%- end -%>
+ <%- if runscript['Command'] -%>
+ Command = "<%= runscript['Command'] %>"
+ <%- end -%>
+ <%- if runscript['Console'] -%>
+ Console = "<%= runscript['Console'] %>"
+ <%- end -%>
+ }
+ <%- end -%>
+<% end -%>
+}
diff --git a/templates/pool.erb b/templates/pool.erb
new file mode 100644
index 0000000..0696e0e
--- /dev/null
+++ b/templates/pool.erb
@@ -0,0 +1,17 @@
+Pool {
+ Name = "<%= @name %>"
+ # All Volumes will have the format director.catalog.date.time to ensure they
+ # are kept unique throughout the operation and also aid quick analysis
+ Label Format = "<%= @fin_label_format%>"
+ Pool Type = <%= @pool_type %>
+ # Clean up any we don't need, and keep them for a maximum of a month (in
+ # theory the same time period for weekly backups from the clients)
+ Recycle = <%= @recycle %>
+ Auto Prune = <%= @auto_prune %>
+ # We have no limit on the number of volumes, but we will simply set that
+ # we should keep at least one weeks worth of backups of the database
+ Volume Retention = <%= @volume_retention %>
+ Maximum Volume Bytes = <%= @max_volume_bytes %>
+ Maximum Volume Jobs = <%= @max_volume_jobs %>
+}
+