bacula::director::db_port: 5432
bacula::director::db_sslca: '/etc/ssl/debian/certs/ca.crt'
+bacula::client::storage_server: storace.debian.org
+
# == other variables
#####################
# this mostly configures the file daemon, but also firewall rules and
# fragments to sent to the other servers.
#
+# @param storage_server The storage server to use for this client
# @param port_fd Port that bacula-fd listens on
# @param ensure present or absent
class bacula::client(
+ String $storage_server,
Integer $port_fd = 9102,
Enum['present', 'absent'] $ensure = defined(Class['bacula::not_a_client']) ? { true => 'absent', default => 'present' },
) inherits bacula {
$reverse_ensure = $ensure ? { 'present' => 'absent', 'absent' => 'present' }
if $ensure == 'present' {
- @@bacula::storage_per_node { $::fqdn: }
+ @@bacula::storage::client { $::fqdn:
+ tag => "bacula::to-storage::${storage_server}"
+ }
@@bacula::node { $::fqdn:
port_fd => $port_fd,
# the bacula storage node
#
# @param backup_path the directory where backups should be stored
+# @param filestor_device Storage device name prefix
+# @param filestor_name Storage device media type name prefix
class bacula::storage (
- String $backup_path = '/srv/bacula',
+ String $backup_path = '/srv/bacula',
+ String $filestor_device = 'FileStorage',
+ String $filestor_name = 'File',
) inherits bacula {
package { 'bacula-sd':
ensure => installed
| EOF
}
- Bacula::Storage_per_node<<| |>>
+ Bacula::Storage::Client<<| tag == "bacula::to-storage::${::fqdn}" |>>
}
--- /dev/null
+# Bacula storage configuration for a client.
+#
+# This is stored config by a client and then collected on the storage
+#
+# @param client The name of the client (relevant for device names, media type names, etc.)
+define bacula::storage::client(
+ String $client = $name
+) {
+ include bacula::storage
+
+ file {
+ "/etc/bacula/storage-conf.d/${client}.conf":
+ content => template('bacula/storage/sd-per-client.conf.erb'),
+ mode => '0440',
+ group => bacula,
+ notify => Exec['bacula-sd restart-when-idle'],
+ ;
+ "${bacula::storage::backup_path}/${client}":
+ ensure => directory,
+ mode => '0755',
+ owner => bacula,
+ group => bacula,
+ ;
+ }
+}
+
+++ /dev/null
-# bacula storage for node. This is stored config by a client, collected on the storage
-define bacula::storage_per_node() {
- include bacula::storage
-
- $bacula_filestor_device = $bacula::bacula_filestor_device
- $bacula_filestor_name = $bacula::bacula_filestor_name
-
- $bacula_client_name = "${name}-fd"
- $client = $name
-
- file {
- "/etc/bacula/storage-conf.d/${name}.conf":
- content => template('bacula/storage-per-client.conf.erb'),
- mode => '0440',
- group => bacula,
- notify => Exec['bacula-sd restart-when-idle'],
- ;
- "${bacula::storage::backup_path}/${name}":
- ensure => directory,
- mode => '0755',
- owner => bacula,
- group => bacula,
- ;
- }
-}
-
+++ /dev/null
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-Device {
- Name = "<%= @bacula_filestor_device %>-<%= @client %>"
- Media Type = "<%= @bacula_filestor_name %>-<%= @client %>"
- Archive Device = "<%= scope['bacula::storage::backup_path'] %>/<%= @client %>"
- LabelMedia = yes;
- Random Access = Yes;
- AutomaticMount = yes;
- RemovableMedia = no;
- AlwaysOpen = no;
-}
--- /dev/null
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+Device {
+ Name = "<%= scope['bacula::storage::filestor_device'] %>-<%= @client %>"
+ Media Type = "<%= scope['bacula::storage::filestor_name'] %>-<%= @client %>"
+ Archive Device = "<%= scope['bacula::storage::backup_path'] %>/<%= @client %>"
+ LabelMedia = yes;
+ Random Access = Yes;
+ AutomaticMount = yes;
+ RemovableMedia = no;
+ AlwaysOpen = no;
+}