-
-
Notifications
You must be signed in to change notification settings - Fork 40
Support Debian 11 #108
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
base: master
Are you sure you want to change the base?
Support Debian 11 #108
Changes from 8 commits
8599229
8543460
dad103b
812ae9f
7d5719c
16c5559
50bca89
2e42adb
cbb7ca5
fbaa120
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,12 +19,12 @@ | |
# The major bareos release version which should be used | ||
# | ||
class bareos::repository ( | ||
Enum['18.2', '19.2', '20', '21'] $release = '20', | ||
Enum['18.2', '19.2', '20', '21'] $release = $bareos::params::repo_release, | ||
Optional[String[1]] $gpg_key_fingerprint = undef, | ||
Boolean $subscription = false, | ||
Optional[String] $username = undef, | ||
Optional[String] $password = undef, | ||
) { | ||
) inherits bareos::params { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if that's required. Do we allow people to use this class directly or should it be marked private? the init.pp calls bareos::repository, that means There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can continue to allow people to use this class directly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in that case we maybe should inherit from bareos instead? that would be a common pattern. Otherwise you end up in situations where people set bareos::repo_release in hiera but that won't be picked up by this class. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As it is, it is impossible because init.pp invoque There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then we can use this default parameter (no Enum['18.2', '19.2', '20', '21'] $release = $bareos::repo_release, No need for inheriting, we can even remove the parameter and use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry but I don't understand what is the advantage of making the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not speaking about the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ooohh no, my bad, I write There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that @smortex is suggesting to reference the |
||
$scheme = 'http://' | ||
if $subscription { | ||
if empty($username) or empty($password) { | ||
|
@@ -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" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,8 @@ | |
"operatingsystem": "Debian", | ||
"operatingsystemrelease": [ | ||
"9", | ||
"10" | ||
"10", | ||
"11" | ||
] | ||
}, | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,22 +33,38 @@ | |
end | ||
end | ||
when 'Debian' | ||
case facts[:operatingsystemmajrelease] | ||
when '20' | ||
context 'with subscription: true, username: "test", password: "test"' do | ||
let(:params) do | ||
{ | ||
subscription: true, | ||
username: 'test', | ||
password: 'test' | ||
} | ||
case facts[:operatingsystem] | ||
when 'Debian' | ||
case facts[:operatingsystemmajrelease] | ||
when '11' | ||
context 'with release: "20"' do | ||
let(:params) do | ||
{ | ||
release: '20' | ||
} | ||
end | ||
|
||
it { is_expected.to compile.and_raise_error(%r{Bareos 20 is not distributed for Debian 11}) } | ||
end | ||
end | ||
when 'Ubuntu' | ||
case facts[:operatingsystemmajrelease] | ||
when '20' | ||
context 'with subscription: true, username: "test", password: "test"' do | ||
let(:params) do | ||
{ | ||
subscription: true, | ||
username: 'test', | ||
password: 'test' | ||
} | ||
end | ||
|
||
it { is_expected.to compile } | ||
it { is_expected.to compile } | ||
|
||
it do | ||
expect(subject).to contain_apt__source('bareos'). | ||
with_location('http://test:[email protected]/bareos/release/latest/xUbuntu_20.04') | ||
it do | ||
expect(subject).to contain_apt__source('bareos'). | ||
with_location('http://test:[email protected]/bareos/release/latest/xUbuntu_20.04') | ||
end | ||
end | ||
end | ||
end | ||
|
Uh oh!
There was an error while loading. Please reload this page.