Skip to content

Commit

Permalink
(MODULES-8326) - apt-transport-https not ensured properly
Browse files Browse the repository at this point in the history
  • Loading branch information
eimlav committed Dec 6, 2018
1 parent 0dba15a commit d53a977
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
}
# Newer oses, do not need the package for HTTPS transport.
$_transport_https_releases = [ 'wheezy', 'jessie', 'stretch', 'trusty', 'xenial' ]
if $_release in $_transport_https_releases and $location =~ /(?i:^https:\/\/)/ {
if ($_release in $_transport_https_releases or $facts['lsbdistcodename'] in $_transport_https_releases) and $location =~ /(?i:^https:\/\/)/ {
ensure_packages('apt-transport-https')
}
}
Expand Down
23 changes: 23 additions & 0 deletions spec/defines/source_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,29 @@
}
end

context 'with a https location and custom release, install apt-transport-https' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '8', full: '8.0' } },
lsbdistid: 'Debian',
lsbdistcodename: 'jessie',
osfamily: 'Debian',
puppetversion: Puppet.version,
}
end
let :params do
{
location: 'HTTPS://foo.bar',
allow_unsigned: false,
release: 'customrelease',
}
end

it {
is_expected.to contain_package('apt-transport-https')
}
end

context 'with a https location, do not install apt-transport-https on oses not in list eg buster' do
let :facts do
{
Expand Down

0 comments on commit d53a977

Please sign in to comment.