From 1bd0accf04399a85d3160b035391e4575f359e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Wed, 30 Aug 2023 10:56:30 -1000 Subject: [PATCH] Make String minimum length explicit All user provided String are expected to be non-empty when they are not undef. --- REFERENCE.md | 206 +++++++++++++++---------------- manifests/client.pp | 18 +-- manifests/director.pp | 46 +++---- manifests/director/client.pp | 14 +-- manifests/director/fileset.pp | 4 +- manifests/director/job.pp | 2 +- manifests/director/pool.pp | 26 ++-- manifests/director/postgresql.pp | 6 +- manifests/director/storage.pp | 6 +- manifests/init.pp | 20 +-- manifests/job.pp | 30 ++--- manifests/jobdefs.pp | 14 +-- manifests/messages.pp | 28 ++--- manifests/schedule.pp | 2 +- manifests/storage.pp | 22 ++-- manifests/storage/device.pp | 12 +- 16 files changed, 228 insertions(+), 228 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 6456b11b..d48436a3 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -95,13 +95,13 @@ The path to the bacula configuration directory ##### `bacula_user` -Data type: `String` +Data type: `String[1]` The posix user for bacula ##### `bacula_group` -Data type: `String` +Data type: `String[1]` The posix group for bacula @@ -119,25 +119,25 @@ The run dir for the daemons ##### `director_address` -Data type: `String` +Data type: `String[1]` The default address of the director used by bconsole ##### `director_name` -Data type: `String` +Data type: `String[1]` The default director name ##### `storage_name` -Data type: `String` +Data type: `String[1]` The default storage name ##### `db_type` -Data type: `String` +Data type: `String[1]` The database provider used by Bacula @@ -145,7 +145,7 @@ Default value: `'pgsql'` ##### `homedir_mode` -Data type: `String` +Data type: `String[1]` The bacula user's home director mode @@ -161,7 +161,7 @@ Default value: `true` ##### `device_seltype` -Data type: `String` +Data type: `String[1]` SELinux type for the device @@ -209,7 +209,7 @@ Default value: `undef` ##### `tls_allowed_cn` -Data type: `Array[String]` +Data type: `Array[String[1]]` Common name attribute of allowed peer certificates @@ -241,7 +241,7 @@ Default value: `undef` ##### `job_tag` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` A tag to add to all job resources @@ -287,37 +287,37 @@ The following parameters are available in the `bacula::client` class: ##### `packages` -Data type: `Array[String]` +Data type: `Array[String[1]]` A list of packages to install; loaded from hiera ##### `services` -Data type: `String` +Data type: `String[1]` A list of services to operate; loaded from hiera ##### `default_pool` -Data type: `String` +Data type: `String[1]` The name of the Pool for this FD to use by default ##### `default_pool_full` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The name of the Pool to use for Full jobs ##### `default_pool_inc` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The name of the Pool to use for Incremental jobs ##### `default_pool_diff` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The name of the Pool to use for Differential jobs @@ -378,7 +378,7 @@ Default value: `2` ##### `director_name` -Data type: `String` +Data type: `String[1]` The hostname of the director for this FD @@ -410,7 +410,7 @@ Default value: `'6 months'` ##### `client` -Data type: `String` +Data type: `String[1]` The name or address by which to contact this FD @@ -418,7 +418,7 @@ Default value: `$trusted['certname']` ##### `address` -Data type: `String` +Data type: `String[1]` The listening address for the File Daemon @@ -516,19 +516,19 @@ The following parameters are available in the `bacula::director` class: ##### `messages` -Data type: `Hash[String, Bacula::Message]` +Data type: `Hash[String[1], Bacula::Message]` Logging configuration; loaded from hiera ##### `packages` -Data type: `Array[String]` +Data type: `Array[String[1]]` A list of packages to install; loaded from hiera ##### `services` -Data type: `String` +Data type: `String[1]` A list of services to operate; loaded from hiera @@ -550,7 +550,7 @@ Default value: `$bacula::conf_dir` ##### `db_name` -Data type: `String` +Data type: `String[1]` The database name @@ -566,7 +566,7 @@ Default value: `'notverysecret'` ##### `db_user` -Data type: `String` +Data type: `String[1]` The database user @@ -574,7 +574,7 @@ Default value: `'bacula'` ##### `db_address` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The database address @@ -590,7 +590,7 @@ Default value: `undef` ##### `director_address` -Data type: `String` +Data type: `String[1]` The address of the director used by bconsole @@ -598,7 +598,7 @@ Default value: `$bacula::director_address` ##### `director` -Data type: `String` +Data type: `String[1]` The name of the director @@ -606,7 +606,7 @@ Default value: `$trusted['certname']` ##### `group` -Data type: `String` +Data type: `String[1]` The posix group for bacula @@ -622,7 +622,7 @@ Default value: `$bacula::homedir` ##### `job_tag` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` A string to use when realizing jobs and filesets @@ -679,7 +679,7 @@ Default value: `$bacula::rundir` ##### `storage_name` -Data type: `String` +Data type: `String[1]` The Name of the Storage daemon @@ -687,7 +687,7 @@ Default value: `$bacula::storage_name` ##### `make_bacula_tables` -Data type: `String` +Data type: `String[1]` Path to the script that loads the database schema @@ -713,7 +713,7 @@ The following parameters are available in the `bacula::director::postgresql` cla ##### `make_bacula_tables` -Data type: `String` +Data type: `String[1]` Path to the script that loads the database schema @@ -721,7 +721,7 @@ Default value: `$bacula::director::make_bacula_tables` ##### `db_name` -Data type: `String` +Data type: `String[1]` The database name @@ -737,7 +737,7 @@ Default value: `$bacula::director::db_pw` ##### `db_user` -Data type: `String` +Data type: `String[1]` The database user @@ -774,13 +774,13 @@ The following parameters are available in the `bacula::storage` class: ##### `services` -Data type: `String` +Data type: `String[1]` A list of services to operate; loaded from hiera ##### `packages` -Data type: `Array[String]` +Data type: `Array[String[1]]` A list of packages to install; loaded from hiera @@ -810,7 +810,7 @@ Default value: `'0770'` ##### `device_name` -Data type: `String` +Data type: `String[1]` The Name that the Director will use when asking to backup or restore to or from to this device @@ -818,7 +818,7 @@ Default value: `"${trusted['certname']}-device"` ##### `device_owner` -Data type: `String` +Data type: `String[1]` The posix user owning the device directory @@ -826,7 +826,7 @@ Default value: `$bacula::bacula_user` ##### `device_seltype` -Data type: `String` +Data type: `String[1]` SELinux type for the device @@ -834,7 +834,7 @@ Default value: `$bacula::device_seltype` ##### `director_name` -Data type: `String` +Data type: `String[1]` Specifies the Name of the Director allowed to connect to the Storage daemon @@ -842,7 +842,7 @@ Default value: `$bacula::director_name` ##### `group` -Data type: `String` +Data type: `String[1]` The posix group for bacula @@ -875,7 +875,7 @@ Default value: `5` ##### `media_type` -Data type: `String` +Data type: `String[1]` The type of media supported by this device @@ -907,7 +907,7 @@ Default value: `$bacula::rundir` ##### `storage` -Data type: `String` +Data type: `String[1]` The address to be configured on the director to communicate with this storage server @@ -915,7 +915,7 @@ Default value: `$trusted['certname']` ##### `address` -Data type: `String` +Data type: `String[1]` The listening address for the Storage Daemon @@ -923,7 +923,7 @@ Default value: `$facts['networking']['fqdn']` ##### `user` -Data type: `String` +Data type: `String[1]` The posix user for bacula @@ -966,13 +966,13 @@ The following parameters are available in the `bacula::director::client` defined ##### `address` -Data type: `String` +Data type: `String[1]` The address of the Bacula File server daemon ##### `port` -Data type: `Variant[String,Stdlib::Port]` +Data type: `Variant[String[1],Stdlib::Port]` The port of the Bacula File server daemon @@ -1050,7 +1050,7 @@ Default value: `$bacula::conf_dir` ##### `director_name` -Data type: `String` +Data type: `String[1]` The name of the director intended to receive this fileset @@ -1066,7 +1066,7 @@ Default value: `[]` ##### `options` -Data type: `Hash[String, Variant[String, Array[String], Bacula::Yesno]]` +Data type: `Hash[String[1], Variant[String[1], Array[String[1]], Bacula::Yesno]]` A hash of options to include in the fileset @@ -1108,7 +1108,7 @@ The following parameters are available in the `bacula::director::job` defined ty ##### `content` -Data type: `String` +Data type: `String[1]` The full content of the job definition @@ -1169,7 +1169,7 @@ Default value: `undef` ##### `maxvoljobs` -Data type: `Optional[Variant[String,Integer[1]]]` +Data type: `Optional[Variant[String[1],Integer[1]]]` Bacula pool configuration option "Maximum Volume Jobs" @@ -1185,7 +1185,7 @@ Default value: `undef` ##### `maxvols` -Data type: `Optional[Variant[String,Integer[1]]]` +Data type: `Optional[Variant[String[1],Integer[1]]]` Bacula pool configuration option "Maximum Volumes" @@ -1193,7 +1193,7 @@ Default value: `undef` ##### `label` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Bacula pool configuration option "Label Format" @@ -1209,7 +1209,7 @@ Default value: `undef` ##### `storage` -Data type: `String` +Data type: `String[1]` Bacula pool configuration option "Storage" @@ -1217,7 +1217,7 @@ Default value: `$bacula::director::storage` ##### `pooltype` -Data type: `String` +Data type: `String[1]` Bacula pool configuration option "Pool Type" @@ -1241,7 +1241,7 @@ Default value: `true` ##### `purgeaction` -Data type: `String` +Data type: `String[1]` Bacula pool configuration option "Action On Purge" @@ -1249,7 +1249,7 @@ Default value: `'Truncate'` ##### `next_pool` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Bacula pool configuration option "Next Pool" @@ -1286,7 +1286,7 @@ The following parameters are available in the `bacula::director::storage` define ##### `address` -Data type: `String` +Data type: `String[1]` Bacula director configuration for Storage option 'SDAddress' @@ -1310,7 +1310,7 @@ Default value: `'secret'` ##### `device_name` -Data type: `String` +Data type: `String[1]` Bacula director configuration for Storage option 'Device' @@ -1318,7 +1318,7 @@ Default value: `"${facts['networking']['fqdn']}-device"` ##### `media_type` -Data type: `String` +Data type: `String[1]` Bacula director configuration for Storage option 'Media Type' @@ -1413,7 +1413,7 @@ Default value: `[]` ##### `fileset` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` If set to true, a fileset will be genereated based on the files and excludes paramaters specified above. If set to false, the job will attempt to use the fileset named "Common". If set to anything else, provided it's a String, that named fileset will be used. NOTE: the fileset Common or the defined fileset must be declared elsewhere for this to work. See Class::Bacula for details @@ -1429,7 +1429,7 @@ Default value: `'Backup'` ##### `template` -Data type: `String` +Data type: `String[1]` Template to use for generating the job configuration fragment @@ -1437,7 +1437,7 @@ Default value: `'bacula/job.conf.epp'` ##### `pool` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Name of the pool to use by default for this job @@ -1445,7 +1445,7 @@ Default value: `undef` ##### `pool_full` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Name of the pool to use for Full jobs @@ -1453,7 +1453,7 @@ Default value: `undef` ##### `pool_inc` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Name of the pool to use for Incremental jobs @@ -1461,7 +1461,7 @@ Default value: `undef` ##### `pool_diff` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Name of the pool to use for Differential jobs @@ -1469,7 +1469,7 @@ Default value: `undef` ##### `storage` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Name of the storage service to use @@ -1477,7 +1477,7 @@ Default value: `undef` ##### `jobdef` -Data type: `Variant[Boolean, String]` +Data type: `Variant[Boolean, String[1]]` If a JobDefs-Resource-Name is specified, all the values contained in the named JobDefs resource will be used as the defaults for the current Job @@ -1493,7 +1493,7 @@ Default value: `[]` ##### `level` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The Level directive specifies the default Job level to be run @@ -1533,7 +1533,7 @@ Default value: `10` ##### `messages` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` containing the name of the message resource to use for this job set to false to disable this option @@ -1549,7 +1549,7 @@ Default value: `'/tmp/bacula-restores'` ##### `sched` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` containing the name of the scheduler set to false to disable this option @@ -1565,7 +1565,7 @@ Default value: `undef` ##### `job_tag` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` that might be used for grouping of jobs. Pass this to bacula::director to only collect jobs that match this tag @@ -1573,7 +1573,7 @@ Default value: `undef` ##### `selection_type` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Determines how the migration job will go about selecting what JobIds to migrate @@ -1581,7 +1581,7 @@ Default value: `undef` ##### `selection_pattern` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Pattern to match against to filter items with selection_type @@ -1597,7 +1597,7 @@ Default value: `1` ##### `write_bootstrap` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The writebootstrap directive specifies a file name where Bacula will write a bootstrap file for each Backup job run @@ -1645,7 +1645,7 @@ Default value: `'Backup'` ##### `sched` -Data type: `String` +Data type: `String[1]` The Schedule directive defines what schedule is to be used for the Job @@ -1653,7 +1653,7 @@ Default value: `'Default'` ##### `messages` -Data type: `String` +Data type: `String[1]` The Messages directive defines what Messages resource should be used for this job, and thus how and where the various messages are to be delivered @@ -1669,7 +1669,7 @@ Default value: `10` ##### `pool` -Data type: `String` +Data type: `String[1]` The Pool directive defines the pool of Volumes where your data can be backed up @@ -1677,7 +1677,7 @@ Default value: `'Default'` ##### `full_backup_pool` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The Full Backup Pool specifies a Pool to be used for Full backups @@ -1685,7 +1685,7 @@ Default value: `undef` ##### `differential_backup_pool` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The Differential Backup Pool specifies a Pool to be used for Differential backups @@ -1693,7 +1693,7 @@ Default value: `undef` ##### `level` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The Level directive specifies the default Job level to be run @@ -1741,7 +1741,7 @@ Default value: `1` ##### `write_bootstrap` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` The writebootstrap directive specifies a file name where Bacula will write a bootstrap file for each Backup job run @@ -1781,7 +1781,7 @@ The following parameters are available in the `bacula::messages` defined type: ##### `append` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Append the message to the filename given in the address field @@ -1789,7 +1789,7 @@ Default value: `undef` ##### `catalog` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Send the message to the Catalog database @@ -1797,7 +1797,7 @@ Default value: `undef` ##### `console` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Send the message to the Bacula console @@ -1813,7 +1813,7 @@ Default value: `'dir'` ##### `director` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Send the message to the Director whose name is given in the address field @@ -1821,7 +1821,7 @@ Default value: `undef` ##### `mailcmd` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Specify exactly how to send the mail @@ -1829,7 +1829,7 @@ Default value: `undef` ##### `mail` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Send the message to the email addresses that are given as a comma separated list in the address field @@ -1837,7 +1837,7 @@ Default value: `undef` ##### `mailonerrorcmd` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Specify exactly how to send error mail @@ -1845,7 +1845,7 @@ Default value: `undef` ##### `mailonerror` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Send the error message to the email addresses that are given as a comma separated list in the address field @@ -1853,7 +1853,7 @@ Default value: `undef` ##### `mailonsuccesscmd` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Specify exactly how to send success mail @@ -1861,7 +1861,7 @@ Default value: `undef` ##### `mailonsuccess` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Send the success message to the email addresses that are given as a comma separated list in the address field @@ -1869,7 +1869,7 @@ Default value: `undef` ##### `mname` -Data type: `String` +Data type: `String[1]` The name of the Messages resource. The name you specify here will be used to tie this Messages resource to a Job and/or to the daemon @@ -1877,7 +1877,7 @@ Default value: `'Standard'` ##### `operatorcmd` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` This resource specification is similar to the MailCommand except that it is used for Operator messages @@ -1885,7 +1885,7 @@ Default value: `undef` ##### `operator` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Send the message to the email addresses that are specified as a comma separated list in the address field @@ -1893,7 +1893,7 @@ Default value: `undef` ##### `syslog` -Data type: `Optional[String]` +Data type: `Optional[String[1]]` Send the message to the system log (syslog) using the facility specified in the address field @@ -1926,7 +1926,7 @@ The following parameters are available in the `bacula::schedule` defined type: ##### `runs` -Data type: `Array[String]` +Data type: `Array[String[1]]` A list of Bacula Run directives @@ -1965,7 +1965,7 @@ The following parameters are available in the `bacula::storage::device` defined ##### `device_name` -Data type: `String` +Data type: `String[1]` Bacula director configuration for Device option 'Name' @@ -1973,7 +1973,7 @@ Default value: `$name` ##### `media_type` -Data type: `String` +Data type: `String[1]` Bacula director configuration for Device option 'Media Type' @@ -2053,7 +2053,7 @@ Default value: `'0770'` ##### `device_owner` -Data type: `String` +Data type: `String[1]` Owner of the Archive Device directory @@ -2061,7 +2061,7 @@ Default value: `$bacula::bacula_user` ##### `device_seltype` -Data type: `String` +Data type: `String[1]` SELinux type for the device @@ -2069,7 +2069,7 @@ Default value: `$bacula::device_seltype` ##### `director_name` -Data type: `String` +Data type: `String[1]` Name of the Director allowed to connect to the Storage daemon @@ -2077,7 +2077,7 @@ Default value: `$bacula::director_name` ##### `group` -Data type: `String` +Data type: `String[1]` The posix group for bacula diff --git a/manifests/client.pp b/manifests/client.pp index 7ad94fcc..ed379f02 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -51,22 +51,22 @@ # class { 'bacula::client': director_name => 'mydirector.example.com' } # class bacula::client ( - Array[String] $packages, - String $services, - String $default_pool, - Optional[String] $default_pool_full, - Optional[String] $default_pool_inc, - Optional[String] $default_pool_diff, + 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 $director_name = $bacula::director_name, + String[1] $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'], + 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, diff --git a/manifests/director.pp b/manifests/director.pp index d396de3e..9d9b9761 100644 --- a/manifests/director.pp +++ b/manifests/director.pp @@ -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, - Stdlib::Absolutepath $conf_dir = $bacula::conf_dir, - String $db_name = 'bacula', - Bacula::Password $db_pw = 'notverysecret', - String $db_user = 'bacula', - Optional[String] $db_address = undef, - Optional[Stdlib::Port] $db_port = undef, - String $director_address = $bacula::director_address, - String $director = $trusted['certname'], # director here is not bacula::director - String $group = $bacula::bacula_group, - Stdlib::Absolutepath $homedir = $bacula::homedir, - Optional[String] $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 $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 diff --git a/manifests/director/client.pp b/manifests/director/client.pp index 37fb8e92..d08dd7a0 100644 --- a/manifests/director/client.pp +++ b/manifests/director/client.pp @@ -23,13 +23,13 @@ # } # define bacula::director::client ( - String $address, - Variant[String,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, + 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, diff --git a/manifests/director/fileset.pp b/manifests/director/fileset.pp index 989aad37..0d2de951 100644 --- a/manifests/director/fileset.pp +++ b/manifests/director/fileset.pp @@ -18,9 +18,9 @@ define bacula::director::fileset ( Array[Stdlib::Absolutepath] $files, Stdlib::Absolutepath $conf_dir = $bacula::conf_dir, - String $director_name = $bacula::director_name, + String[1] $director_name = $bacula::director_name, Array[Stdlib::Absolutepath] $excludes = [], - Hash[String, Variant[String, Array[String], Bacula::Yesno]] $options = { + Hash[String[1], Variant[String[1], Array[String[1]], Bacula::Yesno]] $options = { 'signature' => 'SHA1', 'compression' => 'GZIP9', }, diff --git a/manifests/director/job.pp b/manifests/director/job.pp index a8bddb8b..a1a50bf4 100644 --- a/manifests/director/job.pp +++ b/manifests/director/job.pp @@ -17,7 +17,7 @@ # } # define bacula::director::job ( - String $content, + String[1] $content, Stdlib::Absolutepath $conf_dir = $bacula::conf_dir, ) { include bacula diff --git a/manifests/director/pool.pp b/manifests/director/pool.pp index 76e259b7..892cfc3c 100644 --- a/manifests/director/pool.pp +++ b/manifests/director/pool.pp @@ -29,19 +29,19 @@ # } # define bacula::director::pool ( - Optional[Bacula::Time] $volret = undef, - Optional[Variant[String,Integer[1]]] $maxvoljobs = undef, # FIXME: Remove String - Optional[Bacula::Size] $maxvolbytes = undef, - Optional[Variant[String,Integer[1]]] $maxvols = undef, # FIXME: Remove String - Optional[String] $label = undef, - Optional[Bacula::Time] $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, - Stdlib::Absolutepath $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, diff --git a/manifests/director/postgresql.pp b/manifests/director/postgresql.pp index 0e494a41..10b1c0bb 100644 --- a/manifests/director/postgresql.pp +++ b/manifests/director/postgresql.pp @@ -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[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 $db_user = $bacula::director::db_user, + String[1] $db_user = $bacula::director::db_user, ) { include bacula diff --git a/manifests/director/storage.pp b/manifests/director/storage.pp index f7222d51..8dc7c281 100644 --- a/manifests/director/storage.pp +++ b/manifests/director/storage.pp @@ -16,11 +16,11 @@ # @param conf_dir Bacula configuration directory # define bacula::director::storage ( - String $address = $name, + String[1] $address = $name, Stdlib::Port $port = 9103, Bacula::Password $password = 'secret', - String $device_name = "${facts['networking']['fqdn']}-device", - String $media_type = 'File', + String[1] $device_name = "${facts['networking']['fqdn']}-device", + String[1] $media_type = 'File', Integer[1] $maxconcurjobs = 1, Stdlib::Absolutepath $conf_dir = $bacula::conf_dir, ) { diff --git a/manifests/init.pp b/manifests/init.pp index da93f797..396930d1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -34,27 +34,27 @@ # class bacula ( Stdlib::Absolutepath $conf_dir, - String $bacula_user, - String $bacula_group, + String[1] $bacula_user, + String[1] $bacula_group, Stdlib::Absolutepath $homedir, Stdlib::Absolutepath $rundir, - String $director_address, - String $director_name, - String $storage_name, - String $db_type = 'pgsql', - String $homedir_mode = '0770', + 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 $device_seltype = 'bacula_store_t', + 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] $tls_allowed_cn = [], + 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] $job_tag = undef, + Optional[String[1]] $job_tag = undef, ) { # Do nothing } diff --git a/manifests/job.pp b/manifests/job.pp index 2ef4750a..1ad66da8 100644 --- a/manifests/job.pp +++ b/manifests/job.pp @@ -44,30 +44,30 @@ define bacula::job ( Array[Stdlib::Absolutepath] $files = [], Array[Stdlib::Absolutepath] $excludes = [], - Optional[String] $fileset = undef, + Optional[String[1]] $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', + 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] $level = 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, - Optional[String] $messages = undef, + Optional[String[1]] $messages = undef, Stdlib::Absolutepath $restoredir = '/tmp/bacula-restores', - Optional[String] $sched = undef, + Optional[String[1]] $sched = undef, Optional[Integer] $priority = undef, - Optional[String] $job_tag = undef, - Optional[String] $selection_type = undef, - Optional[String] $selection_pattern = 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] $write_bootstrap = undef, + Optional[String[1]] $write_bootstrap = undef, Optional[Bacula::Time] $max_full_interval = undef, ) { include bacula diff --git a/manifests/jobdefs.pp b/manifests/jobdefs.pp index ba49dcbd..b6280f7f 100644 --- a/manifests/jobdefs.pp +++ b/manifests/jobdefs.pp @@ -20,19 +20,19 @@ # define bacula::jobdefs ( Bacula::JobType $jobtype = 'Backup', - String $sched = 'Default', - String $messages = 'Standard', + String[1] $sched = 'Default', + String[1] $messages = 'Standard', Integer $priority = 10, - String $pool = 'Default', - Optional[String] $full_backup_pool = undef, - Optional[String] $differential_backup_pool = undef, - Optional[String] $level = undef, + 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] $write_bootstrap = undef, + Optional[String[1]] $write_bootstrap = undef, Optional[Bacula::Time] $max_full_interval = undef, ) { include bacula diff --git a/manifests/messages.pp b/manifests/messages.pp index ecf1db1c..7be9946e 100644 --- a/manifests/messages.pp +++ b/manifests/messages.pp @@ -19,21 +19,21 @@ # @param syslog Send the message to the system log (syslog) using the facility specified in the address field # define bacula::messages ( - Optional[String] $append = undef, - Optional[String] $catalog = undef, - Optional[String] $console = undef, + Optional[String[1]] $append = undef, + Optional[String[1]] $catalog = undef, + Optional[String[1]] $console = undef, Enum['dir', 'fd', 'sd'] $daemon = 'dir', - Optional[String] $director = undef, - Optional[String] $mailcmd = undef, - Optional[String] $mail = undef, - Optional[String] $mailonerrorcmd = undef, - Optional[String] $mailonerror = undef, - Optional[String] $mailonsuccesscmd = undef, - Optional[String] $mailonsuccess = undef, - String $mname = 'Standard', - Optional[String] $operatorcmd = undef, - Optional[String] $operator = undef, - Optional[String] $syslog = undef, + Optional[String[1]] $director = undef, + Optional[String[1]] $mailcmd = undef, + Optional[String[1]] $mail = undef, + Optional[String[1]] $mailonerrorcmd = undef, + Optional[String[1]] $mailonerror = undef, + Optional[String[1]] $mailonsuccesscmd = undef, + Optional[String[1]] $mailonsuccess = undef, + String[1] $mname = 'Standard', + Optional[String[1]] $operatorcmd = undef, + Optional[String[1]] $operator = undef, + Optional[String[1]] $syslog = undef, ) { include bacula include bacula::common diff --git a/manifests/schedule.pp b/manifests/schedule.pp index 2dd9ae15..32d8e647 100644 --- a/manifests/schedule.pp +++ b/manifests/schedule.pp @@ -15,7 +15,7 @@ # } # define bacula::schedule ( - Array[String] $runs, + Array[String[1]] $runs, Stdlib::Absolutepath $conf_dir = $bacula::conf_dir, ) { concat::fragment { "bacula-schedule-${name}": diff --git a/manifests/storage.pp b/manifests/storage.pp index 26f804ea..71040483 100644 --- a/manifests/storage.pp +++ b/manifests/storage.pp @@ -25,26 +25,26 @@ # @param user The posix user for bacula # class bacula::storage ( - String $services, - Array[String] $packages, + String[1] $services, + Array[String[1]] $packages, Stdlib::Absolutepath $conf_dir = $bacula::conf_dir, Stdlib::Absolutepath $device = '/bacula', Stdlib::Filemode $device_mode = '0770', - String $device_name = "${trusted['certname']}-device", - String $device_owner = $bacula::bacula_user, - String $device_seltype = $bacula::device_seltype, - String $director_name = $bacula::director_name, - String $group = $bacula::bacula_group, + 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 $media_type = 'File', + String[1] $media_type = 'File', Bacula::Password $password = 'secret', Stdlib::Port $port = 9103, Stdlib::Absolutepath $rundir = $bacula::rundir, - String $storage = $trusted['certname'], # storage here is not storage_name - String $address = $facts['networking']['fqdn'], - String $user = $bacula::bacula_user, + 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 { # Allow for package names to include EPP syntax for db_type $package_names = $packages.map |$p| { diff --git a/manifests/storage/device.pp b/manifests/storage/device.pp index 2ad94678..7a1024be 100644 --- a/manifests/storage/device.pp +++ b/manifests/storage/device.pp @@ -20,8 +20,8 @@ # @param group The posix group for bacula # define bacula::storage::device ( - String $device_name = $name, - String $media_type = 'File', + String[1] $device_name = $name, + String[1] $media_type = 'File', Stdlib::Absolutepath $device = '/bacula', Bacula::Yesno $label_media = true, Bacula::Yesno $random_access = true, @@ -31,10 +31,10 @@ Integer[1] $maxconcurjobs = 1, Stdlib::Absolutepath $conf_dir = $bacula::conf_dir, Stdlib::Filemode $device_mode = '0770', - String $device_owner = $bacula::bacula_user, - String $device_seltype = $bacula::device_seltype, - String $director_name = $bacula::director_name, - String $group = $bacula::bacula_group, + 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, ) { $epp_device_variables = { device_name => $device_name,