Skip to content

Commit

Permalink
Merge pull request #193 from voxpupuli/improve-data-types
Browse files Browse the repository at this point in the history
Improve data types
  • Loading branch information
smortex authored Jan 9, 2025
2 parents 662d553 + 1bc1da9 commit f7e03b4
Show file tree
Hide file tree
Showing 17 changed files with 366 additions and 354 deletions.
319 changes: 163 additions & 156 deletions REFERENCE.md

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,28 +52,28 @@
# class { 'bacula::client': director_name => 'mydirector.example.com' }
#
class bacula::client (
Hash[String, Bacula::Message] $messages,
Array[String] $packages,
String $services,
String $default_pool,
Optional[String] $default_pool_full,
Optional[String] $default_pool_inc,
Optional[String] $default_pool_diff,
Integer $port = 9102,
Array[String[1]] $listen_address = [],
String $password = 'secret',
Integer $max_concurrent_jobs = 2,
String $director_name = $bacula::director_name,
Bacula::Yesno $autoprune = true,
Bacula::Time $file_retention = '45 days',
Bacula::Time $job_retention = '6 months',
String $client = $trusted['certname'],
String $address = $facts['networking']['fqdn'],
Optional[Bacula::Yesno] $pki_signatures = undef,
Optional[Bacula::Yesno] $pki_encryption = undef,
Optional[String] $pki_keypair = undef,
Optional[String] $pki_master_key = undef,
Optional[String] $plugin_dir = undef,
Hash[String, Bacula::Message] $messages,
Array[String[1]] $packages,
String[1] $services,
String[1] $default_pool,
Optional[String[1]] $default_pool_full,
Optional[String[1]] $default_pool_inc,
Optional[String[1]] $default_pool_diff,
Stdlib::Port $port = 9102,
Array[String[1]] $listen_address = [],
Bacula::Password $password = 'secret',
Integer[1] $max_concurrent_jobs = 2,
String[1] $director_name = $bacula::director_name,
Bacula::Yesno $autoprune = true,
Bacula::Time $file_retention = '45 days',
Bacula::Time $job_retention = '6 months',
String[1] $client = $trusted['certname'],
String[1] $address = $facts['networking']['fqdn'],
Optional[Bacula::Yesno] $pki_signatures = undef,
Optional[Bacula::Yesno] $pki_encryption = undef,
Optional[Stdlib::Absolutepath] $pki_keypair = undef,
Optional[Stdlib::Absolutepath] $pki_master_key = undef,
Optional[Stdlib::Absolutepath] $plugin_dir = undef,
) inherits bacula {
$group = $bacula::bacula_group
$conf_dir = $bacula::conf_dir
Expand Down
46 changes: 23 additions & 23 deletions manifests/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,29 @@
# @todo director_address is only used by bconsole, and is confusing as director is likely the same
#
class bacula::director (
Hash[String, Bacula::Message] $messages,
Array[String] $packages,
String $services,
String $make_bacula_tables,
Bacula::Yesno $manage_db = true,
String $conf_dir = $bacula::conf_dir,
String $db_name = 'bacula',
String $db_pw = 'notverysecret',
String $db_user = 'bacula',
Optional[String] $db_address = undef,
Optional[String] $db_port = undef,
String $director_address = $bacula::director_address,
String $director = $trusted['certname'], # director here is not bacula::director
String $group = $bacula::bacula_group,
String $homedir = $bacula::homedir,
Optional[String] $job_tag = $bacula::job_tag,
Array[String[1]] $listen_address = [],
Integer $max_concurrent_jobs = 20,
Boolean $manage_defaults = true,
String $password = 'secret',
Integer $port = 9101,
String $rundir = $bacula::rundir,
String $storage_name = $bacula::storage_name,
Hash[String[1], Bacula::Message] $messages,
Array[String[1]] $packages,
String[1] $services,
String[1] $make_bacula_tables,
Bacula::Yesno $manage_db = true,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
String[1] $db_name = 'bacula',
Bacula::Password $db_pw = 'notverysecret',
String[1] $db_user = 'bacula',
Optional[String[1]] $db_address = undef,
Optional[Stdlib::Port] $db_port = undef,
String[1] $director_address = $bacula::director_address,
String[1] $director = $trusted['certname'], # director here is not bacula::director
String[1] $group = $bacula::bacula_group,
Stdlib::Absolutepath $homedir = $bacula::homedir,
Optional[String[1]] $job_tag = $bacula::job_tag,
Array[String[1]] $listen_address = [],
Integer[1] $max_concurrent_jobs = 20,
Boolean $manage_defaults = true,
Bacula::Password $password = 'secret',
Stdlib::Port $port = 9101,
Stdlib::Absolutepath $rundir = $bacula::rundir,
String[1] $storage_name = $bacula::storage_name,
) inherits bacula {
if $manage_defaults {
include bacula::director::defaults
Expand Down
14 changes: 7 additions & 7 deletions manifests/director/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
# }
#
define bacula::director::client (
String $address,
Variant[String,Integer] $port, # FIXME: Remove String
String $password,
Bacula::Time $file_retention,
Bacula::Time $job_retention,
Bacula::Yesno $autoprune,
String $conf_dir = $bacula::conf_dir,
String[1] $address,
Variant[String[1],Stdlib::Port] $port, # FIXME: Remove String
Bacula::Password $password,
Bacula::Time $file_retention,
Bacula::Time $job_retention,
Bacula::Yesno $autoprune,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
) {
$epp_client_variables = {
name => $name,
Expand Down
10 changes: 5 additions & 5 deletions manifests/director/fileset.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
# }
#
define bacula::director::fileset (
Array[String] $files,
String $conf_dir = $bacula::conf_dir,
String $director_name = $bacula::director_name,
Array[String] $excludes = [],
Hash[String, Variant[String, Array[String], Bacula::Yesno]] $options = {
Array[Stdlib::Absolutepath] $files,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
String[1] $director_name = $bacula::director_name,
Array[Stdlib::Absolutepath] $excludes = [],
Hash[String[1], Variant[String[1], Array[String[1]], Bacula::Yesno]] $options = {
'signature' => 'SHA1',
'compression' => 'GZIP9',
},
Expand Down
4 changes: 2 additions & 2 deletions manifests/director/job.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# }
#
define bacula::director::job (
String $content,
String $conf_dir = $bacula::conf_dir,
String[1] $content,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
) {
include bacula

Expand Down
26 changes: 13 additions & 13 deletions manifests/director/pool.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@
# }
#
define bacula::director::pool (
Optional[String] $volret = undef,
Optional[Variant[String,Integer]] $maxvoljobs = undef, # FIXME: Remove String
Optional[Bacula::Size] $maxvolbytes = undef,
Optional[Variant[String,Integer]] $maxvols = undef, # FIXME: Remove String
Optional[String] $label = undef,
Optional[String] $voluseduration = undef,
String $storage = $bacula::director::storage,
String $pooltype = 'Backup',
Bacula::Yesno $recycle = true,
Bacula::Yesno $autoprune = true,
String $purgeaction = 'Truncate',
Optional[String] $next_pool = undef,
String $conf_dir = $bacula::conf_dir,
Optional[Bacula::Time] $volret = undef,
Optional[Variant[String[1],Integer[1]]] $maxvoljobs = undef, # FIXME: Remove String
Optional[Bacula::Size] $maxvolbytes = undef,
Optional[Variant[String[1],Integer[1]]] $maxvols = undef, # FIXME: Remove String
Optional[String[1]] $label = undef,
Optional[Bacula::Time] $voluseduration = undef,
String[1] $storage = $bacula::director::storage,
String[1] $pooltype = 'Backup',
Bacula::Yesno $recycle = true,
Bacula::Yesno $autoprune = true,
String[1] $purgeaction = 'Truncate',
Optional[String[1]] $next_pool = undef,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
) {
$epp_pool_variables = {
name => $name,
Expand Down
8 changes: 4 additions & 4 deletions manifests/director/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
# @param db_user The database user
#
class bacula::director::postgresql (
String $make_bacula_tables = $bacula::director::make_bacula_tables,
String $db_name = $bacula::director::db_name,
String $db_pw = $bacula::director::db_pw,
String $db_user = $bacula::director::db_user,
String[1] $make_bacula_tables = $bacula::director::make_bacula_tables,
String[1] $db_name = $bacula::director::db_name,
Bacula::Password $db_pw = $bacula::director::db_pw,
String[1] $db_user = $bacula::director::db_user,
) {
include bacula

Expand Down
14 changes: 7 additions & 7 deletions manifests/director/storage.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
# @param conf_dir Bacula configuration directory
#
define bacula::director::storage (
String $address = $name,
Integer $port = 9103,
String $password = 'secret',
String $device_name = "${facts['networking']['fqdn']}-device",
String $media_type = 'File',
Integer $maxconcurjobs = 1,
String $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',
Integer[1] $maxconcurjobs = 1,
Stdlib::Absolutepath $conf_dir = $bacula::conf_dir,
) {
$epp_storage_variables = {
name => $name,
Expand Down
44 changes: 22 additions & 22 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@
# @todo director_address is confusing, and is only used by the bconsole template; Document the use of storage_name; Document the use of director_name
#
class bacula (
String $conf_dir,
String $bacula_user,
String $bacula_group,
String $homedir,
String $rundir,
String $director_address,
String $director_name,
String $storage_name,
String $db_type = 'pgsql',
String $homedir_mode = '0770',
Bacula::Yesno $monitor = true,
String $device_seltype = 'bacula_store_t',
Optional[Bacula::Yesno] $tls_enable = undef,
Optional[Bacula::Yesno] $tls_require = undef,
Optional[String] $tls_certificate = undef,
Optional[String] $tls_key = undef,
Optional[Bacula::Yesno] $tls_verify_peer = undef,
Array[String] $tls_allowed_cn = [],
Optional[String] $tls_ca_certificate_file = undef,
Optional[String] $tls_ca_certificate_dir = undef,
Optional[String] $tls_dh_file = undef,
Optional[String] $job_tag = undef,
Stdlib::Absolutepath $conf_dir,
String[1] $bacula_user,
String[1] $bacula_group,
Stdlib::Absolutepath $homedir,
Stdlib::Absolutepath $rundir,
String[1] $director_address,
String[1] $director_name,
String[1] $storage_name,
String[1] $db_type = 'pgsql',
String[1] $homedir_mode = '0770',
Bacula::Yesno $monitor = true,
String[1] $device_seltype = 'bacula_store_t',
Optional[Bacula::Yesno] $tls_enable = undef,
Optional[Bacula::Yesno] $tls_require = undef,
Optional[Stdlib::Absolutepath] $tls_certificate = undef,
Optional[Stdlib::Absolutepath] $tls_key = undef,
Optional[Bacula::Yesno] $tls_verify_peer = undef,
Array[String[1]] $tls_allowed_cn = [],
Optional[Stdlib::Absolutepath] $tls_ca_certificate_file = undef,
Optional[Stdlib::Absolutepath] $tls_ca_certificate_dir = undef,
Optional[Stdlib::Absolutepath] $tls_dh_file = undef,
Optional[String[1]] $job_tag = undef,
) {
# Do nothing
}
54 changes: 27 additions & 27 deletions manifests/job.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,33 @@
# }
#
define bacula::job (
Array[String] $files = [],
Array[String] $excludes = [],
Optional[String] $fileset = undef,
Bacula::JobType $jobtype = 'Backup',
String $template = 'bacula/job.conf.epp',
Optional[String] $pool = undef,
Optional[String] $pool_full = undef,
Optional[String] $pool_inc = undef,
Optional[String] $pool_diff = undef,
Optional[String] $storage = undef,
Variant[Boolean, String] $jobdef = 'Default',
Array[Bacula::Runscript] $runscript = [],
Optional[String] $level = undef,
Bacula::Yesno $accurate = false,
Bacula::Yesno $reschedule_on_error = false,
Bacula::Time $reschedule_interval = '1 hour',
Integer $reschedule_times = 10,
Optional[String] $messages = undef,
Stdlib::Absolutepath $restoredir = '/tmp/bacula-restores',
Optional[String] $sched = undef,
Optional[Integer] $priority = undef,
Optional[String] $job_tag = undef,
Optional[String] $selection_type = undef,
Optional[String] $selection_pattern = undef,
Integer $max_concurrent_jobs = 1,
Optional[String] $write_bootstrap = undef,
Optional[String] $max_full_interval = undef,
Array[Stdlib::Absolutepath] $files = [],
Array[Stdlib::Absolutepath] $excludes = [],
Optional[String[1]] $fileset = undef,
Bacula::JobType $jobtype = 'Backup',
String[1] $template = 'bacula/job.conf.epp',
Optional[String[1]] $pool = undef,
Optional[String[1]] $pool_full = undef,
Optional[String[1]] $pool_inc = undef,
Optional[String[1]] $pool_diff = undef,
Optional[String[1]] $storage = undef,
Variant[Boolean, String[1]] $jobdef = 'Default',
Array[Bacula::Runscript] $runscript = [],
Optional[String[1]] $level = undef,
Bacula::Yesno $accurate = false,
Bacula::Yesno $reschedule_on_error = false,
Bacula::Time $reschedule_interval = '1 hour',
Integer $reschedule_times = 10,
Optional[String[1]] $messages = undef,
Stdlib::Absolutepath $restoredir = '/tmp/bacula-restores',
Optional[String[1]] $sched = undef,
Optional[Integer] $priority = undef,
Optional[String[1]] $job_tag = undef,
Optional[String[1]] $selection_type = undef,
Optional[String[1]] $selection_pattern = undef,
Integer[1] $max_concurrent_jobs = 1,
Optional[String[1]] $write_bootstrap = undef,
Optional[Bacula::Time] $max_full_interval = undef,
) {
include bacula
include bacula::client
Expand Down
30 changes: 15 additions & 15 deletions manifests/jobdefs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
# @param max_full_interval The time specifies the maximum allowed age (counting from start time) of the most recent successful Full backup that is required in order to run Incremental or Differential backup jobs. f the most recent Full backup is older than this interval, Incremental and Differential backups will be upgraded to Full backups automatically.
#
define bacula::jobdefs (
Bacula::JobType $jobtype = 'Backup',
String $sched = 'Default',
String $messages = 'Standard',
Integer $priority = 10,
String $pool = 'Default',
Optional[String] $full_backup_pool = undef,
Optional[String] $differential_backup_pool = undef,
Optional[String] $level = undef,
Bacula::Yesno $accurate = false,
Bacula::Yesno $reschedule_on_error = false,
Bacula::Time $reschedule_interval = '1 hour',
Integer $reschedule_times = 10,
Integer $max_concurrent_jobs = 1,
Optional[String] $write_bootstrap = undef,
Optional[String] $max_full_interval = undef,
Bacula::JobType $jobtype = 'Backup',
String[1] $sched = 'Default',
String[1] $messages = 'Standard',
Integer $priority = 10,
String[1] $pool = 'Default',
Optional[String[1]] $full_backup_pool = undef,
Optional[String[1]] $differential_backup_pool = undef,
Optional[String[1]] $level = undef,
Bacula::Yesno $accurate = false,
Bacula::Yesno $reschedule_on_error = false,
Bacula::Time $reschedule_interval = '1 hour',
Integer $reschedule_times = 10,
Integer[1] $max_concurrent_jobs = 1,
Optional[String[1]] $write_bootstrap = undef,
Optional[Bacula::Time] $max_full_interval = undef,
) {
include bacula
$conf_dir = $bacula::conf_dir
Expand Down
Loading

0 comments on commit f7e03b4

Please sign in to comment.