Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 11 additions & 12 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,18 @@
assert_private()
case $facts['os']['family'] {
'Debian': {
apt::keyring { 'apt_gitlabci':
source => $repo_keysource,
name => 'gitlab_ci_runner.asc',
}
apt::source { 'apt_gitlabci':
comment => 'GitlabCI Runner Repo',
location => "${repo_base_url}/runner/${package_name}/${facts['os']['distro']['id'].downcase}/",
repos => 'main',
key => {
'name' => 'gitlab_ci_runner.asc',
'source' => $repo_keysource,
'server' => $repo_keyserver,
},
include => {
'src' => false,
'deb' => true,
},
source_format => 'sources',
comment => 'GitlabCI Runner Repo',
location => ["${repo_base_url}/runner/${package_name}/${facts['os']['distro']['id'].downcase}/",],
keyring => '/etc/apt/keyrings/gitlab_ci_runner.asc',
repos => ['main',],
types => ['deb',],
require => Apt::Keyring['apt_gitlabci'],
}
Apt::Source['apt_gitlabci'] -> Package[$package_name]
Exec['apt_update'] -> Package[$package_name]
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
{
"name": "puppetlabs/apt",
"version_requirement": ">= 6.3.0 < 12.0.0"
"version_requirement": ">= 10.0.0 < 12.0.0"
}
],
"operatingsystem_support": [
Expand Down
60 changes: 8 additions & 52 deletions spec/classes/gitlab_ci_runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,17 +375,10 @@
is_expected.to contain_apt__source('apt_gitlabci').
with(
comment: 'GitlabCI Runner Repo',
location: "https://packages.gitlab.com/runner/gitlab-runner/#{facts[:os]['name'].downcase}/",
repos: 'main',
key: {
'name' => 'gitlab_ci_runner.asc',
'server' => undef_value,
'source' => 'https://packages.gitlab.com/gpg.key',
},
include: {
'src' => false,
'deb' => true
}
location: ["https://packages.gitlab.com/runner/gitlab-runner/#{facts[:os]['name'].downcase}/",],
repos: ['main',],
types: ['deb'],
keyring: '/etc/apt/keyrings/gitlab_ci_runner.asc'
)
end
when 'RedHat'
Expand Down Expand Up @@ -446,54 +439,17 @@
end

if facts[:os]['family'] == 'Debian'
# <= v3.0.0
context 'with manage_repo => true and repo_keyserver => keys.gnupg.net' do
let(:params) do
super().merge(
manage_repo: true,
repo_keyserver: 'keys.gnupg.net'
)
end

it { is_expected.to compile }
it { is_expected.to contain_class('gitlab_ci_runner::repo') }

it do
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')
end
end

# allowed > 3.0.0 (see issue #101)
context 'with manage_repo => true and repo_keyserver => hkp://keys.gnupg.net:80' do
let(:params) do
super().merge(
manage_repo: true,
repo_keyserver: 'hkp://keys.gnupg.net:80'
)
end

it { is_expected.to compile }
it { is_expected.to contain_class('gitlab_ci_runner::repo') }

it do
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')
end
end

context 'with manage_repo => true and repo_keyserver => https://keys.gnupg.net:88' do
context 'with manage_repo => true' do
let(:params) do
super().merge(
manage_repo: true,
repo_keyserver: 'https://keys.gnupg.net:88'
manage_repo: true
)
end

it { is_expected.to compile }
it { is_expected.to contain_class('gitlab_ci_runner::repo') }

it do
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')
end
it { is_expected.to contain_apt__keyring('apt_gitlabci') }
it { is_expected.to contain_apt__source('apt_gitlabci') }
end
end
end
Expand Down