Skip to content

Commit

Permalink
add $ensure parameter for all package operations
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed Jul 29, 2024
1 parent 16a70ab commit ba96a65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand All @@ -78,7 +80,7 @@
$config_file = "${conf_dir}/bacula-fd.conf"

package { $packages:
ensure => present,
ensure => $ensure,
}

service { $services:
Expand Down
4 changes: 3 additions & 1 deletion manifests/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -85,7 +87,7 @@
}
)
}
ensure_packages($package_names)
ensure_packages($package_names, { ensure => $ensure })

service { $services:
ensure => running,
Expand Down
4 changes: 3 additions & 1 deletion manifests/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
Expand Down Expand Up @@ -54,7 +56,7 @@
}
)
}
ensure_packages($package_names)
ensure_packages($package_names, { ensure => $ensure })

service { $services:
ensure => running,
Expand Down

0 comments on commit ba96a65

Please sign in to comment.