Skip to content

Commit c8d5224

Browse files
authored
Merge pull request #237 from cusae/deb822
Debian family: use deb822 format for apt::source
2 parents c9c7522 + 3f84b9d commit c8d5224

3 files changed

Lines changed: 20 additions & 65 deletions

File tree

manifests/repo.pp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@
1313
assert_private()
1414
case $facts['os']['family'] {
1515
'Debian': {
16+
apt::keyring { 'apt_gitlabci':
17+
source => $repo_keysource,
18+
name => 'gitlab_ci_runner.asc',
19+
}
1620
apt::source { 'apt_gitlabci':
17-
comment => 'GitlabCI Runner Repo',
18-
location => "${repo_base_url}/runner/${package_name}/${facts['os']['distro']['id'].downcase}/",
19-
repos => 'main',
20-
key => {
21-
'name' => 'gitlab_ci_runner.asc',
22-
'source' => $repo_keysource,
23-
'server' => $repo_keyserver,
24-
},
25-
include => {
26-
'src' => false,
27-
'deb' => true,
28-
},
21+
source_format => 'sources',
22+
comment => 'GitlabCI Runner Repo',
23+
location => ["${repo_base_url}/runner/${package_name}/${facts['os']['distro']['id'].downcase}/",],
24+
keyring => '/etc/apt/keyrings/gitlab_ci_runner.asc',
25+
repos => ['main',],
26+
types => ['deb',],
27+
require => Apt::Keyring['apt_gitlabci'],
2928
}
3029
Apt::Source['apt_gitlabci'] -> Package[$package_name]
3130
Exec['apt_update'] -> Package[$package_name]

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
{
2424
"name": "puppetlabs/apt",
25-
"version_requirement": ">= 6.3.0 < 12.0.0"
25+
"version_requirement": ">= 10.0.0 < 12.0.0"
2626
}
2727
],
2828
"operatingsystem_support": [

spec/classes/gitlab_ci_runner_spec.rb

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -375,17 +375,10 @@
375375
is_expected.to contain_apt__source('apt_gitlabci').
376376
with(
377377
comment: 'GitlabCI Runner Repo',
378-
location: "https://packages.gitlab.com/runner/gitlab-runner/#{facts[:os]['name'].downcase}/",
379-
repos: 'main',
380-
key: {
381-
'name' => 'gitlab_ci_runner.asc',
382-
'server' => undef_value,
383-
'source' => 'https://packages.gitlab.com/gpg.key',
384-
},
385-
include: {
386-
'src' => false,
387-
'deb' => true
388-
}
378+
location: ["https://packages.gitlab.com/runner/gitlab-runner/#{facts[:os]['name'].downcase}/",],
379+
repos: ['main',],
380+
types: ['deb'],
381+
keyring: '/etc/apt/keyrings/gitlab_ci_runner.asc'
389382
)
390383
end
391384
when 'RedHat'
@@ -446,54 +439,17 @@
446439
end
447440

448441
if facts[:os]['family'] == 'Debian'
449-
# <= v3.0.0
450-
context 'with manage_repo => true and repo_keyserver => keys.gnupg.net' do
451-
let(:params) do
452-
super().merge(
453-
manage_repo: true,
454-
repo_keyserver: 'keys.gnupg.net'
455-
)
456-
end
457-
458-
it { is_expected.to compile }
459-
it { is_expected.to contain_class('gitlab_ci_runner::repo') }
460-
461-
it do
462-
is_expected.to contain_apt__source('apt_gitlabci').with_key('name' => 'gitlab_ci_runner.asc', 'source' => 'https://packages.gitlab.com/gpg.key', 'server' => 'keys.gnupg.net')
463-
end
464-
end
465-
466-
# allowed > 3.0.0 (see issue #101)
467-
context 'with manage_repo => true and repo_keyserver => hkp://keys.gnupg.net:80' do
468-
let(:params) do
469-
super().merge(
470-
manage_repo: true,
471-
repo_keyserver: 'hkp://keys.gnupg.net:80'
472-
)
473-
end
474-
475-
it { is_expected.to compile }
476-
it { is_expected.to contain_class('gitlab_ci_runner::repo') }
477-
478-
it do
479-
is_expected.to contain_apt__source('apt_gitlabci').with_key('name' => 'gitlab_ci_runner.asc', 'source' => 'https://packages.gitlab.com/gpg.key', 'server' => 'hkp://keys.gnupg.net:80')
480-
end
481-
end
482-
483-
context 'with manage_repo => true and repo_keyserver => https://keys.gnupg.net:88' do
442+
context 'with manage_repo => true' do
484443
let(:params) do
485444
super().merge(
486-
manage_repo: true,
487-
repo_keyserver: 'https://keys.gnupg.net:88'
445+
manage_repo: true
488446
)
489447
end
490448

491449
it { is_expected.to compile }
492450
it { is_expected.to contain_class('gitlab_ci_runner::repo') }
493-
494-
it do
495-
is_expected.to contain_apt__source('apt_gitlabci').with_key('name' => 'gitlab_ci_runner.asc', 'source' => 'https://packages.gitlab.com/gpg.key', 'server' => 'https://keys.gnupg.net:88')
496-
end
451+
it { is_expected.to contain_apt__keyring('apt_gitlabci') }
452+
it { is_expected.to contain_apt__source('apt_gitlabci') }
497453
end
498454
end
499455
end

0 commit comments

Comments
 (0)