Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,13 @@ The following parameters are available in the `bacula::storage` class:
* [`device_name`](#-bacula--storage--device_name)
* [`device_owner`](#-bacula--storage--device_owner)
* [`device_seltype`](#-bacula--storage--device_seltype)
* [`device_max_concurrent_jobs`](#-bacula--storage--device_max_concurrent_jobs)
* [`director_name`](#-bacula--storage--director_name)
* [`group`](#-bacula--storage--group)
* [`homedir`](#-bacula--storage--homedir)
* [`listen_address`](#-bacula--storage--listen_address)
* [`maxconcurjobs`](#-bacula--storage--maxconcurjobs)
* [`max_concurrent_jobs`](#-bacula--storage--max_concurrent_jobs)
* [`media_type`](#-bacula--storage--media_type)
* [`password`](#-bacula--storage--password)
* [`port`](#-bacula--storage--port)
Expand Down Expand Up @@ -868,6 +870,14 @@ SELinux type for the device

Default value: `$bacula::device_seltype`

##### <a name="-bacula--storage--device_max_concurrent_jobs"></a>`device_max_concurrent_jobs`

Data type: `Integer[1]`

The maximum number of Jobs that may run concurrently on the device

Default value: `5`

##### <a name="-bacula--storage--director_name"></a>`director_name`

Data type: `String[1]`
Expand Down Expand Up @@ -903,11 +913,19 @@ Default value: `[]`

##### <a name="-bacula--storage--maxconcurjobs"></a>`maxconcurjobs`

Data type: `Optional[Integer[1]]`

DEPRECATED maximum number of Jobs that may run concurrently

Default value: `undef`

##### <a name="-bacula--storage--max_concurrent_jobs"></a>`max_concurrent_jobs`

Data type: `Integer[1]`

maximum number of Jobs that may run concurrently
The maximum number of Jobs that may run concurrently

Default value: `5`
Default value: `20`
Comment on lines -910 to +928

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a backwards-incompatible change, but the old value here is what was used for the new device_max_concurrent_jobs. The job limit was missing and limiting the storage daemon to a single job only, which was not expected.


##### <a name="-bacula--storage--media_type"></a>`media_type`

Expand Down Expand Up @@ -1439,6 +1457,7 @@ The following parameters are available in the `bacula::director::storage` define
* [`device_name`](#-bacula--director--storage--device_name)
* [`media_type`](#-bacula--director--storage--media_type)
* [`maxconcurjobs`](#-bacula--director--storage--maxconcurjobs)
* [`max_concurrent_jobs`](#-bacula--director--storage--max_concurrent_jobs)
* [`conf_dir`](#-bacula--director--storage--conf_dir)

##### <a name="-bacula--director--storage--address"></a>`address`
Expand Down Expand Up @@ -1483,6 +1502,14 @@ Default value: `'File'`

##### <a name="-bacula--director--storage--maxconcurjobs"></a>`maxconcurjobs`

Data type: `Optional[Integer[1]]`

DEPRECATED Bacula director configuration for Storage option 'Maximum Concurrent Jobs'

Default value: `undef`

##### <a name="-bacula--director--storage--max_concurrent_jobs"></a>`max_concurrent_jobs`

Data type: `Integer[1]`

Bacula director configuration for Storage option 'Maximum Concurrent Jobs'
Expand Down Expand Up @@ -2113,6 +2140,7 @@ The following parameters are available in the `bacula::storage::device` defined
* [`removable_media`](#-bacula--storage--device--removable_media)
* [`always_open`](#-bacula--storage--device--always_open)
* [`maxconcurjobs`](#-bacula--storage--device--maxconcurjobs)
* [`max_concurrent_jobs`](#-bacula--storage--device--max_concurrent_jobs)
* [`conf_dir`](#-bacula--storage--device--conf_dir)
* [`device_mode`](#-bacula--storage--device--device_mode)
* [`device_owner`](#-bacula--storage--device--device_owner)
Expand Down Expand Up @@ -2186,6 +2214,14 @@ Default value: `false`

##### <a name="-bacula--storage--device--maxconcurjobs"></a>`maxconcurjobs`

Data type: `Optional[Integer[1]]`

DEPRECATED Bacula director configuration for Device option 'Maximum Concurrent Jobs'

Default value: `undef`

##### <a name="-bacula--storage--device--max_concurrent_jobs"></a>`max_concurrent_jobs`

Data type: `Integer[1]`

Bacula director configuration for Device option 'Maximum Concurrent Jobs'
Expand Down
48 changes: 27 additions & 21 deletions manifests/director/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,37 @@
# resource, so that each storage server is available as a configuration on the
# director.
#
# @param address Bacula director configuration for Storage option 'SDAddress'
# @param port Bacula director configuration for Storage option 'SDPort'
# @param password Bacula director configuration for Storage option 'Password'
# @param device_name Bacula director configuration for Storage option 'Device'
# @param media_type Bacula director configuration for Storage option 'Media Type'
# @param maxconcurjobs Bacula director configuration for Storage option 'Maximum Concurrent Jobs'
# @param conf_dir Bacula configuration directory
# @param address Bacula director configuration for Storage option 'SDAddress'
# @param port Bacula director configuration for Storage option 'SDPort'
# @param password Bacula director configuration for Storage option 'Password'
# @param device_name Bacula director configuration for Storage option 'Device'
# @param media_type Bacula director configuration for Storage option 'Media Type'
# @param maxconcurjobs DEPRECATED Bacula director configuration for Storage option 'Maximum Concurrent Jobs'
# @param max_concurrent_jobs Bacula director configuration for Storage option 'Maximum Concurrent Jobs'
# @param conf_dir Bacula configuration directory
#
define bacula::director::storage (
String[1] $address = $name,
Stdlib::Port $port = 9103,
Bacula::Password $password = 'secret',
String[1] $device_name = "${facts['networking']['fqdn']}-device",
String[1] $media_type = 'File',
Integer[1] $maxconcurjobs = 1,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
String[1] $address = $name,
Stdlib::Port $port = 9103,
Bacula::Password $password = 'secret',
String[1] $device_name = "${facts['networking']['fqdn']}-device",
String[1] $media_type = 'File',
Optional[Integer[1]] $maxconcurjobs = undef,
Integer[1] $max_concurrent_jobs = 1,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
) {
if $maxconcurjobs {
deprecation('bacula::director::maxconcurjobs', 'This parameter is deprecated. Use bacula::director::max_concurrent_jobs instead.')
}

$epp_storage_variables = {
name => $name,
address => $address,
port => $port,
password => $password,
device_name => $device_name,
media_type => $media_type,
maxconcurjobs => $maxconcurjobs,
name => $name,
address => $address,
port => $port,
password => $password,
device_name => $device_name,
media_type => $media_type,
max_concurrent_jobs => pick($maxconcurjobs, $max_concurrent_jobs),
}

concat::fragment { "bacula-director-storage-${name}":
Expand Down
106 changes: 57 additions & 49 deletions manifests/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,60 @@
#
# This class configures the Bacula storage daemon.
#
# @param services A list of services to operate; loaded from hiera
# @param packages A list of packages to install; loaded from hiera
# @param ensure What state the package should be in.
# @param conf_dir Path to bacula configuration directory
# @param device The system file name of the storage device managed by this storage daemon
# @param device_mode The posix mode for device
# @param device_name The Name that the Director will use when asking to backup or restore to or from to this device
# @param device_owner The posix user owning the device directory
# @param device_seltype SELinux type for the device
# @param director_name Specifies the Name of the Director allowed to connect to the Storage daemon
# @param group The posix group for bacula
# @param homedir The directory in which the Storage daemon may put its status files
# @param listen_address The listening IP addresses for the storage daemon
# @param services A list of services to operate; loaded from hiera
# @param packages A list of packages to install; loaded from hiera
# @param ensure What state the package should be in.
# @param conf_dir Path to bacula configuration directory
# @param device The system file name of the storage device managed by this storage daemon
# @param device_mode The posix mode for device
# @param device_name The Name that the Director will use when asking to backup or restore to or from to this device
# @param device_owner The posix user owning the device directory
# @param device_seltype SELinux type for the device
# @param device_max_concurrent_jobs The maximum number of Jobs that may run concurrently on the device
# @param director_name Specifies the Name of the Director allowed to connect to the Storage daemon
# @param group The posix group for bacula
# @param homedir The directory in which the Storage daemon may put its status files
# @param listen_address The listening IP addresses for the storage daemon
# The notes for `bacula::client::listen_address` apply.
# @param maxconcurjobs maximum number of Jobs that may run concurrently
# @param media_type The type of media supported by this device
# @param password Specifies the password that must be supplied by the named Director
# @param port The listening port for the Storage Daemon
# @param rundir The directory in which the Director may put its process Id file files
# @param storage The address to be configured on the director to communicate with this storage server
# @param address The listening address for the Storage Daemon
# @param user The posix user for bacula
# @param maxconcurjobs DEPRECATED maximum number of Jobs that may run concurrently
# @param max_concurrent_jobs The maximum number of Jobs that may run concurrently
# @param media_type The type of media supported by this device
# @param password Specifies the password that must be supplied by the named Director
# @param port The listening port for the Storage Daemon
# @param rundir The directory in which the Director may put its process Id file files
# @param storage The address to be configured on the director to communicate with this storage server
# @param address The listening address for the Storage Daemon
# @param user The posix user for bacula
#
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,
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,
Integer[1] $device_max_concurrent_jobs = 5,
String[1] $director_name = $bacula::director_name,
String[1] $group = $bacula::bacula_group,
Stdlib::Absolutepath $homedir = $bacula::homedir,
Array[String[1]] $listen_address = [],
Optional[Integer[1]] $maxconcurjobs = undef,
Integer[1] $max_concurrent_jobs = 20,
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 {
if $maxconcurjobs {
deprecation('bacula::storage::maxconcurjobs', 'This parameter is deprecated. Use bacula::storage::device_max_concurrent_jobs instead.')
}

# Allow for package names to include EPP syntax for db_type
$package_names = $packages.map |$p| {
$package_name = inline_epp($p,
Expand All @@ -71,8 +79,8 @@
}

bacula::storage::device { $device_name:
device => $device,
maxconcurjobs => $maxconcurjobs,
device => $device,
max_concurrent_jobs => pick($maxconcurjobs, $device_max_concurrent_jobs),
}

concat::fragment { 'bacula-storage-dir':
Expand All @@ -99,12 +107,12 @@
}

@@bacula::director::storage { $storage:
address => $address,
port => $port,
password => $password,
device_name => $device_name,
media_type => $media_type,
maxconcurjobs => $maxconcurjobs,
tag => "bacula-${director_name}",
address => $address,
port => $port,
password => $password,
device_name => $device_name,
media_type => $media_type,
max_concurrent_jobs => $max_concurrent_jobs,
tag => "bacula-${director_name}",
}
}
84 changes: 45 additions & 39 deletions manifests/storage/device.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,57 @@
# This define creates a storage device declaration. This informs the
# storage daemon which storage devices are available to send client backups to.
#
# @param device_name Bacula director configuration for Device option 'Name'
# @param media_type Bacula director configuration for Device option 'Media Type'
# @param device Bacula director configuration for Device option 'Archive Device'
# @param label_media Bacula director configuration for Device option 'LabelMedia'
# @param random_access Bacula director configuration for Device option 'Random Access'
# @param automatic_mount Bacula director configuration for Device option 'AutomaticMount'
# @param removable_media Bacula director configuration for Device option 'RemovableMedia'
# @param always_open Bacula director configuration for Device option 'AlwaysOpen'
# @param maxconcurjobs Bacula director configuration for Device option 'Maximum Concurrent Jobs'
# @param conf_dir Path to bacula configuration directory
# @param device_mode Unix mode of the Archive Device directory
# @param device_owner Owner of the Archive Device directory
# @param device_seltype SELinux type for the device
# @param director_name Name of the Director allowed to connect to the Storage daemon
# @param group The posix group for bacula
# @param device_name Bacula director configuration for Device option 'Name'
# @param media_type Bacula director configuration for Device option 'Media Type'
# @param device Bacula director configuration for Device option 'Archive Device'
# @param label_media Bacula director configuration for Device option 'LabelMedia'
# @param random_access Bacula director configuration for Device option 'Random Access'
# @param automatic_mount Bacula director configuration for Device option 'AutomaticMount'
# @param removable_media Bacula director configuration for Device option 'RemovableMedia'
# @param always_open Bacula director configuration for Device option 'AlwaysOpen'
# @param maxconcurjobs DEPRECATED Bacula director configuration for Device option 'Maximum Concurrent Jobs'
# @param max_concurrent_jobs Bacula director configuration for Device option 'Maximum Concurrent Jobs'
# @param conf_dir Path to bacula configuration directory
# @param device_mode Unix mode of the Archive Device directory
# @param device_owner Owner of the Archive Device directory
# @param device_seltype SELinux type for the device
# @param director_name Name of the Director allowed to connect to the Storage daemon
# @param group The posix group for bacula
#
define bacula::storage::device (
String[1] $device_name = $name,
String[1] $media_type = 'File',
Stdlib::Absolutepath $device = '/bacula',
Bacula::Yesno $label_media = true,
Bacula::Yesno $random_access = true,
Bacula::Yesno $automatic_mount = true,
Bacula::Yesno $removable_media = false,
Bacula::Yesno $always_open = false,
Integer[1] $maxconcurjobs = 1,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
Stdlib::Filemode $device_mode = '0770',
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,
String[1] $device_name = $name,
String[1] $media_type = 'File',
Stdlib::Absolutepath $device = '/bacula',
Bacula::Yesno $label_media = true,
Bacula::Yesno $random_access = true,
Bacula::Yesno $automatic_mount = true,
Bacula::Yesno $removable_media = false,
Bacula::Yesno $always_open = false,
Optional[Integer[1]] $maxconcurjobs = undef,
Integer[1] $max_concurrent_jobs = 1,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
Stdlib::Filemode $device_mode = '0770',
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,
) {
include bacula::storage

if $maxconcurjobs {
deprecation('bacula::storage::device::maxconcurjobs', 'This parameter is deprecated. Use bacula::storage::device::max_concurrent_jobs instead.')
}

$epp_device_variables = {
device_name => $device_name,
media_type => $media_type,
device => $device,
label_media => $label_media,
random_access => $random_access,
automatic_mount => $automatic_mount,
removable_media => $removable_media,
always_open => $always_open,
maxconcurjobs => $maxconcurjobs,
device_name => $device_name,
media_type => $media_type,
device => $device,
label_media => $label_media,
random_access => $random_access,
automatic_mount => $automatic_mount,
removable_media => $removable_media,
always_open => $always_open,
max_concurrent_jobs => pick($maxconcurjobs, $max_concurrent_jobs),
}

concat::fragment { "bacula-storage-device-${name}":
Expand Down
Loading
Loading