Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Debian 11 #108

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
6 changes: 5 additions & 1 deletion manifests/repository.pp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@
}
$location = "${url}xUbuntu_${osrelease}"
} else {
if $osmajrelease == '10' {
if versioncmp($osmajrelease, '10') >= 0 {
if (versioncmp($release, '18.2') <= 0)
or ((versioncmp($release, '20') <= 0) and (versioncmp($osmajrelease, '11') >= 0)) {
fail("Bareos ${release} is not distributed for Debian ${osmajrelease}")
}
$location = "${url}Debian_${osmajrelease}"
} else {
$location = "${url}Debian_${osmajrelease}.0"
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"operatingsystem": "Debian",
"operatingsystemrelease": [
"9",
"10"
"10",
"11"
]
},
{
Expand Down
11 changes: 9 additions & 2 deletions spec/classes/repository_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@
end

context 'with default values for all parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('bareos::repository') }
if (facts[:osfamily] == 'Debian') && (facts[:operatingsystemmajrelease] == '11')
it 'fails' do
expect { is_expected.to contain_class('bareos::repository') }.
to raise_error(Puppet::PreformattedError, %r{is not distributed for})
end
FlorentPoinsaut marked this conversation as resolved.
Show resolved Hide resolved
else
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_class('bareos::repository') }
end
end

case facts[:osfamily]
Expand Down