Puppet Class: bacula::storage
- Inherits:
- bacula
- Defined in:
- manifests/storage.pp
Summary
Configure a Bacula Storage DaemonOverview
This class configures the Bacula storage daemon.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'manifests/storage.pp', line 28
class bacula::storage (
String[1] $services,
Array[String[1]] $packages,
String[1] $ensure = 'present',
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
Stdlib::Absolutepath $device = '/bacula',
Stdlib::Filemode $device_mode = '0770',
String[1] $device_name = "${trusted['certname']}-device",
String[1] $device_owner = $bacula::bacula_user,
String[1] $device_seltype = $bacula::device_seltype,
String[1] $director_name = $bacula::director_name,
String[1] $group = $bacula::bacula_group,
Stdlib::Absolutepath $homedir = $bacula::homedir,
Array[String[1]] $listen_address = [],
Integer[1] $maxconcurjobs = 5,
String[1] $media_type = 'File',
Bacula::Password $password = 'secret',
Stdlib::Port $port = 9103,
Stdlib::Absolutepath $rundir = $bacula::rundir,
String[1] $storage = $trusted['certname'], # storage here is not storage_name
String[1] $address = $facts['networking']['fqdn'],
String[1] $user = $bacula::bacula_user,
) inherits bacula {
# Allow for package names to include EPP syntax for db_type
$package_names = $packages.map |$p| {
$package_name = inline_epp($p,
{
'db_type' => $bacula::db_type
}
)
}
ensure_packages($package_names, { ensure => $ensure })
service { $services:
ensure => running,
enable => true,
require => Package[$package_names],
}
concat::fragment { 'bacula-storage-header':
order => '00',
target => "${conf_dir}/bacula-sd.conf",
content => epp('bacula/bacula-sd-header.epp'),
}
bacula::storage::device { $device_name:
device => $device,
maxconcurjobs => $maxconcurjobs,
}
concat::fragment { 'bacula-storage-dir':
target => "${conf_dir}/bacula-sd.conf",
content => epp('bacula/bacula-sd-dir.epp'),
}
bacula::messages { 'Standard-sd':
daemon => 'sd',
director => "${director_name}-dir = all",
append => '"/var/log/bacula/bacula-sd.log" = all, !skipped',
}
# Realize the clause the director is exporting here so we can allow access to
# the storage daemon Adds an entry to ${conf_dir}/bacula-sd.conf
Concat::Fragment <<| tag == "bacula-storage-dir-${director_name}" |>>
concat { "${conf_dir}/bacula-sd.conf":
owner => 'root',
group => $group,
mode => '0640',
show_diff => false,
notify => Service[$services],
}
@@bacula::director::storage { $storage:
address => $address,
port => $port,
password => $password,
device_name => $device_name,
media_type => $media_type,
maxconcurjobs => $maxconcurjobs,
tag => "bacula-${director_name}",
}
}
|