Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
15 changes: 12 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ The following parameters are available in the `bareos` class:
* [`file_group`](#-bareos--file_group)
* [`file_mode`](#-bareos--file_mode)
* [`file_dir_mode`](#-bareos--file_dir_mode)
* [`user_groups`](#-bareos--user_groups)
* [`console_package_name`](#-bareos--console_package_name)
* [`monitor_package_name`](#-bareos--monitor_package_name)
* [`director_package_name`](#-bareos--director_package_name)
Expand All @@ -120,7 +121,7 @@ Data type: `String`

The major bareos release version which should be used

Default value: `'21'`
Default value: `'22'`

##### <a name="-bareos--repo_subscription"></a>`repo_subscription`

Expand Down Expand Up @@ -274,6 +275,14 @@ Data type: `Any`

Default value: `$bareos::params::file_dir_mode`

##### <a name="-bareos--user_groups"></a>`user_groups`

Data type: `Any`



Default value: `$bareos::params::user_groups`

##### <a name="-bareos--console_package_name"></a>`console_package_name`

Data type: `Any`
Expand Down Expand Up @@ -2227,11 +2236,11 @@ The following parameters are available in the `bareos::repository` class:

##### <a name="-bareos--repository--release"></a>`release`

Data type: `Enum['19.2', '20', '21']`
Data type: `Enum['19.2', '20', '21', '22']`

The major bareos release version which should be used

Default value: `'21'`
Default value: `'22'`

##### <a name="-bareos--repository--gpg_key_fingerprint"></a>`gpg_key_fingerprint`

Expand Down
5 changes: 3 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
$file_group = $bareos::params::file_group,
$file_mode = $bareos::params::file_mode,
$file_dir_mode = $bareos::params::file_dir_mode,
String $repo_release = '21',
$user_groups = $bareos::params::user_groups,
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a data type for this new parameter? Probably Array[String[1]].

Copy link
Member

Choose a reason for hiding this comment

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

Also, as it is a new parameter, do not put the default value in params.pp but put it here. That way, the actual value is documented when you generate the documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you don't mind, I'd like to add that as part of attempting to get #154 incorporated, as well. If you do mind, of course, I'm not opposed to adding it, here, it just feels vaguely like making a style shift like that all at once is "cleaner?"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, as it is a new parameter, do not put the default value in params.pp but put it here. That way, the actual value is documented when you generate the documentation.

I was mostly aiming to port the original author's work mostly-unmolested, but I also find the use of params.pp here icky. Is it better to try and stick with a clean rebase, or should I just go ahead and fix things While I'm In Here™?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After some discussion out-of-band, I've added updates to remove $user_groups from params.pp and add typing for the param in init.pp.

String $repo_release = '22',
Copy link
Member

Choose a reason for hiding this comment

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

Changing the default version make it a breaking change. This is just a FYI, if the latest version is 22 we can change the default in the next (major) version. I will add a backward-incompatible label accordingly.

Copy link
Member

Choose a reason for hiding this comment

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

I see #161 is about adding support for bareos 23. Do you plan to rebase this version too next?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The latest version is actually 24 - there's another PR that adds support for version 23 that I'd like to ALSO get merged, and if someone wants to cut a new (breaking) release, well, master already contains unreleased breaking changes at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

👍 we can do a single major release that default to 24 then, I think it is sensible.

Boolean $repo_subscription = false,
Optional[String[1]] $repo_username = undef,
Optional[String[1]] $repo_password = undef,
Expand Down Expand Up @@ -92,7 +93,7 @@
comment => 'Bareos system user',
home => '/var/lib/bareos',
shell => '/bin/false',
groups => ['disk', 'tape', $file_group],
groups => ['disk', 'tape', $file_group] + $user_groups,
system => true,
tag => ['bareos', 'bareos_core'],
}
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
$file_dir_mode = '0755'
$file_owner = 'bareos'
$file_group = 'bareos'
$user_groups = []
$config_dir = '/etc/bareos'
$config_dir_webui = '/etc/bareos-webui'

Expand Down
16 changes: 10 additions & 6 deletions manifests/repository.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
# Whether https should be used in repo URL
#
class bareos::repository (
Enum['19.2', '20', '21'] $release = '21',
Optional[String[1]] $gpg_key_fingerprint = undef,
Boolean $subscription = false,
Optional[String] $username = undef,
Optional[String] $password = undef,
Boolean $https = true,
Enum['19.2', '20', '21', '22'] $release = '22',
Optional[String[1]] $gpg_key_fingerprint = undef,
Boolean $subscription = false,
Optional[String] $username = undef,
Optional[String] $password = undef,
Boolean $https = true,
) {
if $https {
$scheme = 'https://'
Expand All @@ -43,6 +43,9 @@

if $gpg_key_fingerprint {
$_gpg_key_fingerprint = $gpg_key_fingerprint
} elsif versioncmp($release, '22') >= 0 {
# >= bareos 21
$_gpg_key_fingerprint = '5D44 2966 81A7 3289 DBEE 58E4 59E9 68A5 59FE 211E'
} elsif versioncmp($release, '21') >= 0 {
# >= bareos 21
$_gpg_key_fingerprint = '91DA 1DC3 564A E20A 76C4 CA88 E019 57D6 C9FE D482'
Expand Down Expand Up @@ -146,6 +149,7 @@
Apt::Source['bareos'] -> Package <| provider == 'apt' |>
Class['Apt::Update'] -> Package <| provider == 'apt' |>
}
'windows': {}
default: {
fail('Operatingsystem is not supported by this module')
}
Expand Down
Loading