Skip to content

Commit

Permalink
add compatibility of Debian 11 with Bareos 20
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentPoinsaut committed Mar 16, 2022
1 parent 2e42adb commit cbb7ca5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
17 changes: 1 addition & 16 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,7 @@
$file_group = 'bareos'
$config_dir = '/etc/bareos'
$config_dir_webui = '/etc/bareos-webui'

case $facts['os']['name'] {
'Debian': {
case $facts['os']['release']['major'] {
'11': {
$repo_release = '21'
}
default: {
$repo_release = '20'
}
}
}
default: {
$repo_release = '20'
}
}
$repo_release = '20'

# service/package specific
# bconsole
Expand Down
2 changes: 1 addition & 1 deletion manifests/repository.pp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
} else {
if versioncmp($osmajrelease, '10') >= 0 {
if (versioncmp($release, '18.2') <= 0)
or ((versioncmp($release, '20') <= 0) and (versioncmp($osmajrelease, '11') >= 0)) {
or ((versioncmp($release, '20') < 0) and (versioncmp($osmajrelease, '11') >= 0)) {
fail("Bareos ${release} is not distributed for Debian ${osmajrelease}")
}
$location = "${url}Debian_${osmajrelease}"
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
when 'Debian'
case facts[:operatingsystemmajrelease]
when '11'
context 'with release: "20"' do
context 'with release: "19.2"' do
let(:params) do
{
release: '20'
release: '19.2'
}
end

it { is_expected.to compile.and_raise_error(%r{Bareos 20 is not distributed for Debian 11}) }
it { is_expected.to compile.and_raise_error(%r{Bareos 19.2 is not distributed for Debian 11}) }
end
end
when 'Ubuntu'
Expand Down

0 comments on commit cbb7ca5

Please sign in to comment.