2022-02-02 22:55:23 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-02-03 15:47:19 +01:00
|
|
|
case platform.family
|
2022-02-02 23:32:48 +01:00
|
|
|
when 'redhat'
|
2022-02-02 22:55:23 +01:00
|
|
|
repo_file = '/etc/yum.repos.d/passenger.repo'
|
|
|
|
repo_url = 'https://oss-binaries.phusionpassenger.com/yum/passenger/el/$releasever/$basearch'
|
2022-02-02 23:32:48 +01:00
|
|
|
when 'debian'
|
2022-02-08 17:47:21 +01:00
|
|
|
codename = system.platform[:codename]
|
2022-02-02 22:55:23 +01:00
|
|
|
repo_keyring = '/usr/share/keyrings/phusionpassenger-archive-keyring.gpg'
|
|
|
|
repo_file = "/etc/apt/sources.list.d/phusionpassenger-official-#{codename}.list"
|
2022-02-08 17:47:21 +01:00
|
|
|
# rubocop:disable Layout/LineLength
|
2022-02-02 22:55:23 +01:00
|
|
|
repo_url = "deb [signed-by=#{repo_keyring}] https://oss-binaries.phusionpassenger.com/apt/passenger #{codename} main"
|
2022-02-08 17:47:21 +01:00
|
|
|
# rubocop:enable Layout/LineLength
|
2022-02-02 22:55:23 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
control 'Phusion-passenger repository keyring' do
|
|
|
|
title 'should be installed'
|
|
|
|
|
|
|
|
only_if('Requirement for Debian family') do
|
|
|
|
os.debian?
|
|
|
|
end
|
|
|
|
|
|
|
|
describe file(repo_keyring) do
|
|
|
|
it { should exist }
|
|
|
|
it { should be_owned_by 'root' }
|
|
|
|
it { should be_grouped_into 'root' }
|
|
|
|
its('mode') { should cmp '0644' }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
control 'Phusion-passenger repository' do
|
|
|
|
impact 1
|
|
|
|
title 'should be configured'
|
|
|
|
describe file(repo_file) do
|
|
|
|
its('content') { should include repo_url }
|
|
|
|
end
|
|
|
|
end
|