diff --git a/REFERENCE.md b/REFERENCE.md
index cea8beaf..4107713c 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -263,6 +263,7 @@ class { 'bacula::client': director_name => 'mydirector.example.com' }
The following parameters are available in the `bacula::client` class:
* [`packages`](#-bacula--client--packages)
+* [`ensure`](#-bacula--client--ensure)
* [`services`](#-bacula--client--services)
* [`default_pool`](#-bacula--client--default_pool)
* [`default_pool_full`](#-bacula--client--default_pool_full)
@@ -290,6 +291,14 @@ Data type: `Array[String]`
A list of packages to install; loaded from hiera
+##### `ensure`
+
+Data type: `String`
+
+What state the package should be in.
+
+Default value: `'present'`
+
##### `services`
Data type: `String`
@@ -491,6 +500,7 @@ The following parameters are available in the `bacula::director` class:
* [`messages`](#-bacula--director--messages)
* [`packages`](#-bacula--director--packages)
+* [`ensure`](#-bacula--director--ensure)
* [`services`](#-bacula--director--services)
* [`manage_db`](#-bacula--director--manage_db)
* [`conf_dir`](#-bacula--director--conf_dir)
@@ -525,6 +535,14 @@ Data type: `Array[String]`
A list of packages to install; loaded from hiera
+##### `ensure`
+
+Data type: `String`
+
+What state the package should be in.
+
+Default value: `'present'`
+
##### `services`
Data type: `String`
@@ -752,6 +770,7 @@ The following parameters are available in the `bacula::storage` class:
* [`services`](#-bacula--storage--services)
* [`packages`](#-bacula--storage--packages)
+* [`ensure`](#-bacula--storage--ensure)
* [`conf_dir`](#-bacula--storage--conf_dir)
* [`device`](#-bacula--storage--device)
* [`device_mode`](#-bacula--storage--device_mode)
@@ -783,6 +802,14 @@ Data type: `Array[String]`
A list of packages to install; loaded from hiera
+##### `ensure`
+
+Data type: `String`
+
+What state the package should be in.
+
+Default value: `'present'`
+
##### `conf_dir`
Data type: `String`
diff --git a/manifests/client.pp b/manifests/client.pp
index dcaf1cbe..77d30cf8 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -3,6 +3,7 @@
# This class installs and configures the File Daemon to backup a client system.
#
# @param packages A list of packages to install; loaded from hiera
+# @param ensure What state the package should be in.
# @param services A list of services to operate; loaded from hiera
# @param default_pool The name of the Pool for this FD to use by default
# @param default_pool_full The name of the Pool to use for Full jobs
@@ -57,6 +58,7 @@
Optional[String] $default_pool_full,
Optional[String] $default_pool_inc,
Optional[String] $default_pool_diff,
+ String $ensure = 'present',
Integer $port = 9102,
Array[String[1]] $listen_address = [],
String $password = 'secret',
@@ -78,7 +80,7 @@
$config_file = "${conf_dir}/bacula-fd.conf"
package { $packages:
- ensure => present,
+ ensure => $ensure,
}
service { $services:
diff --git a/manifests/director.pp b/manifests/director.pp
index 40e0b7b1..dad73a21 100644
--- a/manifests/director.pp
+++ b/manifests/director.pp
@@ -4,6 +4,7 @@
#
# @param messages Logging configuration; loaded from hiera
# @param packages A list of packages to install; loaded from hiera
+# @param ensure What state the package should be in.
# @param services A list of services to operate; loaded from hiera
# @param manage_db Whether the module should manage the director database
# @param conf_dir Path to bacula configuration directory
@@ -39,6 +40,7 @@
Array[String] $packages,
String $services,
String $make_bacula_tables,
+ String $ensure = 'present',
Bacula::Yesno $manage_db = true,
String $conf_dir = $bacula::conf_dir,
String $db_name = 'bacula',
@@ -85,7 +87,7 @@
}
)
}
- ensure_packages($package_names)
+ ensure_packages($package_names, { ensure => $ensure })
service { $services:
ensure => running,
diff --git a/manifests/storage.pp b/manifests/storage.pp
index f407d648..00fe6f40 100644
--- a/manifests/storage.pp
+++ b/manifests/storage.pp
@@ -4,6 +4,7 @@
#
# @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
@@ -27,6 +28,7 @@
class bacula::storage (
String $services,
Array[String] $packages,
+ String $ensure = 'present',
String $conf_dir = $bacula::conf_dir,
String $device = '/bacula',
Stdlib::Filemode $device_mode = '0770',
@@ -54,7 +56,7 @@
}
)
}
- ensure_packages($package_names)
+ ensure_packages($package_names, { ensure => $ensure })
service { $services:
ensure => running,