test(repository): use system.platform[:codename]
[skip ci]
Tested: * https://gitlab.com/myii/nginx-formula/-/pipelines/470231421
This commit is contained in:
parent
5f1a289f11
commit
0e51694c2a
@ -5,21 +5,12 @@ when 'redhat'
|
|||||||
repo_file = '/etc/yum.repos.d/passenger.repo'
|
repo_file = '/etc/yum.repos.d/passenger.repo'
|
||||||
repo_url = 'https://oss-binaries.phusionpassenger.com/yum/passenger/el/$releasever/$basearch'
|
repo_url = 'https://oss-binaries.phusionpassenger.com/yum/passenger/el/$releasever/$basearch'
|
||||||
when 'debian'
|
when 'debian'
|
||||||
# Inspec does not provide a `codename` matcher, so we add ours
|
codename = system.platform[:codename]
|
||||||
finger_codename = {
|
|
||||||
'ubuntu-18.04' => 'bionic',
|
|
||||||
'ubuntu-20.04' => 'focal',
|
|
||||||
'debian-9' => 'stretch',
|
|
||||||
'debian-10' => 'buster',
|
|
||||||
'debian-11' => 'bullseye'
|
|
||||||
}
|
|
||||||
codename = finger_codename[system.platform[:finger]]
|
|
||||||
|
|
||||||
repo_keyring = '/usr/share/keyrings/phusionpassenger-archive-keyring.gpg'
|
repo_keyring = '/usr/share/keyrings/phusionpassenger-archive-keyring.gpg'
|
||||||
repo_file = "/etc/apt/sources.list.d/phusionpassenger-official-#{codename}.list"
|
repo_file = "/etc/apt/sources.list.d/phusionpassenger-official-#{codename}.list"
|
||||||
# rubocop:disable Metrics/LineLength
|
# rubocop:disable Layout/LineLength
|
||||||
repo_url = "deb [signed-by=#{repo_keyring}] https://oss-binaries.phusionpassenger.com/apt/passenger #{codename} main"
|
repo_url = "deb [signed-by=#{repo_keyring}] https://oss-binaries.phusionpassenger.com/apt/passenger #{codename} main"
|
||||||
# rubocop:enable Metrics/LineLength
|
# rubocop:enable Layout/LineLength
|
||||||
end
|
end
|
||||||
|
|
||||||
control 'Phusion-passenger repository keyring' do
|
control 'Phusion-passenger repository keyring' do
|
||||||
|
Loading…
Reference in New Issue
Block a user