bacula::director::db_port: 5432
bacula::director::db_sslca: '/etc/ssl/debian/certs/ca.crt'
+bacula::client::director_server: dinis.debian.org
bacula::client::storage_server: storace.debian.org
# this mostly configures the file daemon, but also firewall rules and
# fragments to sent to the other servers.
#
+# @param director_server The director server that controls this client's backups
# @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 $director_server,
String $storage_server,
Integer $port_fd = 9102,
Enum['present', 'absent'] $ensure = defined(Class['bacula::not_a_client']) ? { true => 'absent', default => 'present' },
tag => "bacula::to-storage::${storage_server}"
}
- @@bacula::node { $::fqdn:
+ @@bacula::director::client { $::fqdn:
port_fd => $port_fd,
+ tag => "bacula::to-director::${director_server}"
}
@@concat::fragment { "bacula-dsa-client-list::${::fqdn}":
--- /dev/null
+# Bacula configuration for a client, pushed from the storage.
+#
+# This is stored config by a storage and then collected on the client.
+#
+define bacula::client::storage(
+) {
+ include bacula::client
+
+}
notify => Exec['bacula-director reload']
}
- Bacula::Node<<| |>>
+ Bacula::Director::Client<<| tag == "bacula::to-director::${::fqdn}" |>>
package { 'bacula-console':
ensure => installed;
--- /dev/null
+# Bacula client config on the director
+#
+# This is stored config by a client, collected on the director
+#
+# @param port_fd port that this node's bacula-fd is listening on
+# @param client The name of the client (relevant for device names, media type names, etc.)
+define bacula::director::client (
+ Integer $port_fd = 9102,
+ String $client = $name,
+) {
+ include bacula
+
+ $bacula_pool_name = $bacula::bacula_pool_name
+ $bacula_filestor_name = $bacula::bacula_filestor_name
+ $bacula_filestor_device = $bacula::bacula_filestor_device
+ $bacula_storage_address = $bacula::bacula_storage_address
+ $bacula_storage_port = $bacula::bacula_storage_port
+ $bacula_storage_secret = $bacula::bacula_storage_secret
+
+ $bacula_ca_path = $bacula::bacula_ca_path
+ $bacula_ssl_client_cert = $bacula::bacula_ssl_client_cert
+ $bacula_ssl_client_key = $bacula::bacula_ssl_client_key
+
+ $bacula_client_name = "${client}-fd"
+ $bacula_client_secret = hkdf('/etc/puppet/secret', "bacula-fd-${client}")
+
+ file { "/etc/bacula/conf.d/${client}.conf":
+ content => template('bacula/director/dir-per-client.erb'),
+ mode => '0440',
+ group => bacula,
+ notify => Exec['bacula-director reload']
+ }
+
+ file { "/etc/bacula/storages-list.d/${client}.storage":
+ content => "${bacula::bacula_filestor_client}-${client}\n",
+ mode => '0440',
+ group => bacula,
+ notify => Exec['bacula-director reload']
+ }
+}
+
+++ /dev/null
-# Bacula client config on the director
-#
-# This is stored config by a client, collected on the director
-#
-# @param port_fd port that this node's bacula-fd is listening on
-define bacula::node (
- Integer $port_fd = 9102,
-) {
- include bacula
-
- $bacula_pool_name = $bacula::bacula_pool_name
- $bacula_filestor_name = $bacula::bacula_filestor_name
- $bacula_filestor_device = $bacula::bacula_filestor_device
- $bacula_storage_address = $bacula::bacula_storage_address
- $bacula_storage_port = $bacula::bacula_storage_port
- $bacula_storage_secret = $bacula::bacula_storage_secret
-
- $bacula_ca_path = $bacula::bacula_ca_path
- $bacula_ssl_client_cert = $bacula::bacula_ssl_client_cert
- $bacula_ssl_client_key = $bacula::bacula_ssl_client_key
-
- $bacula_client_name = "${name}-fd"
- $bacula_client_secret = hkdf('/etc/puppet/secret', "bacula-fd-${name}")
- $client = $name
-
- file { "/etc/bacula/conf.d/${name}.conf":
- content => template('bacula/per-client.conf.erb'),
- mode => '0440',
- group => bacula,
- notify => Exec['bacula-director reload']
- }
-
- file { "/etc/bacula/storages-list.d/${name}.storage":
- content => "${bacula::bacula_filestor_name}-${client}\n",
- mode => '0440',
- group => bacula,
- notify => Exec['bacula-director reload']
- }
-}
-
--- /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
+##
+# For Bacula release 5.0.1 (24 February 2010) -- debian 5.0.4
+
+Job {
+ Name = "<%= @client %>"
+ JobDefs = "Standardbackup"
+ Client = <%= @bacula_client_name %>
+
+ Pool = "poolfull-<%= @bacula_pool_name %>-<%= @client %>"
+ Differential Backup Pool = "pooldiff-<%= @bacula_pool_name %>-<%= @client %>"
+ Incremental Backup Pool = "poolinc-<%= @bacula_pool_name %>-<%= @client %>"
+
+ Reschedule On Error = yes
+ Reschedule Interval = 4 hours
+ Reschedule Times = 2
+
+ Cancel Lower Level Duplicates = yes
+ Cancel Queued Duplicates = yes
+}
+
+# Client (File Services) to backup
+Client {
+ Name = <%= @bacula_client_name %>
+ Address = <%= @client %>
+ FDPort = <%= @port_fd %>
+ Catalog = MyCatalog
+ Password = "<%= @bacula_client_secret %>"
+ File Retention = 30 days
+ Job Retention = 3 months
+ AutoPrune = yes
+
+ TLS Enable = yes
+ TLS Require = yes
+ TLS CA Certificate File = "<%= @bacula_ca_path %>"
+ # This is a client certificate, used by the director to connect to the client's file daemon
+ TLS Certificate = "<%= @bacula_ssl_client_cert %>"
+ TLS Key = "<%= @bacula_ssl_client_key %>"
+}
+
+########################################################################
+# Storage config #
+########################################################################
+
+Storage {
+ Name = "<%= @bacula_filestor_name %>-<%= @client %>"
+ Address = <%= @bacula_storage_address %>
+ SDPort = <%= @bacula_storage_port %>
+ Password = "<%= @bacula_storage_secret %>"
+ Device = "<%= @bacula_filestor_device %>-<%= @client %>"
+ Media Type = "<%= @bacula_filestor_name %>-<%= @client %>"
+ Maximum Concurrent Jobs = 10
+
+ TLS Enable = yes
+ TLS Require = yes
+ TLS CA Certificate File = "<%= @bacula_ca_path %>"
+ # This is a client certificate, used by the director to connect to the storage daemon
+ TLS Certificate = "<%= @bacula_ssl_client_cert %>"
+ TLS Key = "<%= @bacula_ssl_client_key %>"
+}
+
+########################################################################
+# Pool definition #
+########################################################################
+Pool {
+ Name = "poolfull-<%=@bacula_pool_name%>-<%= @client %>"
+ Pool Type = Backup
+ Storage = "<%=@bacula_filestor_name%>-<%= @client %>"
+ AutoPrune = yes
+ Volume Retention = 100 days
+ Label Format = "<%= @bacula_pool_name %>-full-<%= @client %>.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
+ Volume Use Duration = 23h
+ Maximum Volume Jobs = 1
+ Maximum Volume Bytes = 500G
+ Action On Purge = Truncate
+ Recycle = yes
+ RecyclePool = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
+}
+
+Pool {
+ Name = "pooldiff-<%=@bacula_pool_name%>-<%= @client %>"
+ Pool Type = Backup
+ Storage = "<%=@bacula_filestor_name%>-<%= @client %>"
+ AutoPrune = yes
+ Volume Retention = 50 days
+ Label Format = "<%= @bacula_pool_name %>-diff-<%= @client %>.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
+ Volume Use Duration = 23h
+ Maximum Volume Jobs = 1
+ Maximum Volume Bytes = 500G
+ Action On Purge = Truncate
+ Recycle = yes
+ RecyclePool = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
+}
+
+Pool {
+ Name = "poolinc-<%=@bacula_pool_name%>-<%= @client %>"
+ Pool Type = Backup
+ Storage = "<%=@bacula_filestor_name%>-<%= @client %>"
+ AutoPrune = yes
+ Volume Retention = 30 days
+ Label Format = "<%= @bacula_pool_name %>-inc-<%= @client %>.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
+ Volume Use Duration = 23h
+ Maximum Volume Jobs = 1
+ Maximum Volume Bytes = 500G
+ Action On Purge = Truncate
+ Recycle = yes
+ RecyclePool = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
+}
+
+Pool {
+ Name = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
+ Pool Type = Backup
+ Storage = "<%=@bacula_filestor_name%>-<%= @client %>"
+ Recycle = yes
+ RecyclePool = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
+}
+++ /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
-##
-# For Bacula release 5.0.1 (24 February 2010) -- debian 5.0.4
-
-Job {
- Name = "<%= @client %>"
- JobDefs = "Standardbackup"
- Client = <%= @bacula_client_name %>
-
- Pool = "poolfull-<%= @bacula_pool_name %>-<%= @client %>"
- Differential Backup Pool = "pooldiff-<%= @bacula_pool_name %>-<%= @client %>"
- Incremental Backup Pool = "poolinc-<%= @bacula_pool_name %>-<%= @client %>"
-
- Reschedule On Error = yes
- Reschedule Interval = 4 hours
- Reschedule Times = 2
-
- Cancel Lower Level Duplicates = yes
- Cancel Queued Duplicates = yes
-}
-
-# Client (File Services) to backup
-Client {
- Name = <%= @bacula_client_name %>
- Address = <%= @client %>
- FDPort = <%= @port_fd %>
- Catalog = MyCatalog
- Password = "<%= @bacula_client_secret %>"
- File Retention = 30 days
- Job Retention = 3 months
- AutoPrune = yes
-
- TLS Enable = yes
- TLS Require = yes
- TLS CA Certificate File = "<%= @bacula_ca_path %>"
- # This is a client certificate, used by the director to connect to the client's file daemon
- TLS Certificate = "<%= @bacula_ssl_client_cert %>"
- TLS Key = "<%= @bacula_ssl_client_key %>"
-}
-
-########################################################################
-# Storage config #
-########################################################################
-
-Storage {
- Name = "<%= @bacula_filestor_name %>-<%= @client %>"
- Address = <%= @bacula_storage_address %>
- SDPort = <%= @bacula_storage_port %>
- Password = "<%= @bacula_storage_secret %>"
- Device = "<%= @bacula_filestor_device %>-<%= @client %>"
- Media Type = "<%= @bacula_filestor_name %>-<%= @client %>"
- Maximum Concurrent Jobs = 10
-
- TLS Enable = yes
- TLS Require = yes
- TLS CA Certificate File = "<%= @bacula_ca_path %>"
- # This is a client certificate, used by the director to connect to the storage daemon
- TLS Certificate = "<%= @bacula_ssl_client_cert %>"
- TLS Key = "<%= @bacula_ssl_client_key %>"
-}
-
-########################################################################
-# Pool definition #
-########################################################################
-Pool {
- Name = "poolfull-<%=@bacula_pool_name%>-<%= @client %>"
- Pool Type = Backup
- Storage = "<%=@bacula_filestor_name%>-<%= @client %>"
- AutoPrune = yes
- Volume Retention = 100 days
- Label Format = "<%= @bacula_pool_name %>-full-<%= @client %>.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
- Volume Use Duration = 23h
- Maximum Volume Jobs = 1
- Maximum Volume Bytes = 500G
- Action On Purge = Truncate
- Recycle = yes
- RecyclePool = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
-}
-
-Pool {
- Name = "pooldiff-<%=@bacula_pool_name%>-<%= @client %>"
- Pool Type = Backup
- Storage = "<%=@bacula_filestor_name%>-<%= @client %>"
- AutoPrune = yes
- Volume Retention = 50 days
- Label Format = "<%= @bacula_pool_name %>-diff-<%= @client %>.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
- Volume Use Duration = 23h
- Maximum Volume Jobs = 1
- Maximum Volume Bytes = 500G
- Action On Purge = Truncate
- Recycle = yes
- RecyclePool = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
-}
-
-Pool {
- Name = "poolinc-<%=@bacula_pool_name%>-<%= @client %>"
- Pool Type = Backup
- Storage = "<%=@bacula_filestor_name%>-<%= @client %>"
- AutoPrune = yes
- Volume Retention = 30 days
- Label Format = "<%= @bacula_pool_name %>-inc-<%= @client %>.${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}_${Hour:p/2/0/r}:${Minute:p/2/0/r}"
- Volume Use Duration = 23h
- Maximum Volume Jobs = 1
- Maximum Volume Bytes = 500G
- Action On Purge = Truncate
- Recycle = yes
- RecyclePool = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
-}
-
-Pool {
- Name = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
- Pool Type = Backup
- Storage = "<%=@bacula_filestor_name%>-<%= @client %>"
- Recycle = yes
- RecyclePool = "poolgraveyard-<%=@bacula_pool_name%>-<%= @client %>"
-}