Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Switch packages mirror protocol to https #86

Merged
merged 1 commit into from
Sep 29, 2017
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
3 changes: 2 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#
# [*repo_key_source*]
# String
# Default: http://repositories.sensuapp.org/apt/pubkey.gpg
# Default: https://repositories.sensuapp.org/apt/pubkey.gpg
# GPG key for the repo we're installing
#
# [*manage_package*]
Expand Down Expand Up @@ -139,6 +139,7 @@
$version = $uchiwa::params::version,
$install_repo = $uchiwa::params::install_repo,
$repo = $uchiwa::params::repo,
$repo_release = $uchiwa::params::repo_release,
$repo_source = $uchiwa::params::repo_source,
$repo_key_id = $uchiwa::params::repo_key_id,
$repo_key_source = $uchiwa::params::repo_key_source,
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
$version = 'latest'
$install_repo = true
$repo = 'main'
$repo_release = undef
$repo_source = undef
$repo_key_id = 'EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB'
$repo_key_source = 'http://repositories.sensuapp.org/apt/pubkey.gpg'
$repo_key_source = 'https://repositories.sensuapp.org/apt/pubkey.gpg'
$manage_services = true
$manage_package = true
$manage_user = true
Expand Down
12 changes: 10 additions & 2 deletions manifests/repo/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@
if $uchiwa::repo_source {
$url = $uchiwa::repo_source
} else {
$url = 'http://repositories.sensuapp.org/apt'
$url = 'https://repositories.sensuapp.org/apt'
}

# ignoring the puppet-lint plugin because of a bug that warns on the next
# line.
if $::uchiwa::repo_release == undef { #lint:ignore:undef_in_function
$release = $::lsbdistcodename
} else {
$release = $::uchiwa::repo_release
}

apt::source { 'uchiwa':
Expand All @@ -34,7 +42,7 @@
'source' => $uchiwa::repo_key_source,
},
location => $url,
release => 'sensu',
release => $release,
repos => $uchiwa::repo,
}

Expand Down
21 changes: 15 additions & 6 deletions spec/classes/uchiwa_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
let(:facts) {
{
:osfamily => 'Debian',
:lsbdistcodename => 'jessie',
:fqdn => 'testhost.domain.com',
:concat_basedir => '/dne'
}
Expand All @@ -53,18 +54,26 @@
context 'default' do
it { should contain_apt__source('uchiwa').with(
:ensure => 'present',
:location => 'http://repositories.sensuapp.org/apt',
:release => 'sensu',
:location => 'https://repositories.sensuapp.org/apt',
:release => 'jessie',
:repos => 'main',
:include => { 'src' => false, 'deb' => true },
:key => { 'id' => 'EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB', 'source' => 'http://repositories.sensuapp.org/apt/pubkey.gpg' },
:key => { 'id' => 'EE15CFF6AB6E4E290FDAB681A20F259AEB9C94BB', 'source' => 'https://repositories.sensuapp.org/apt/pubkey.gpg' },
:before => 'Package[uchiwa]'
) }
end

context 'unstable repo' do
let(:params) { { :repo => 'unstable' } }
it { should contain_apt__source('uchiwa').with_repos('unstable') }
let(:params) {
{
:repo => 'unstable',
:repo_release => 'stretch',
}
}
it { should contain_apt__source('uchiwa').with(
:repos => 'unstable',
:release => 'stretch'
)}
end

context 'override repo url' do
Expand Down Expand Up @@ -93,7 +102,7 @@

it { should_not contain_apt__key('uchiwa').with(
:key => '7580C77F',
:key_source => 'http://repositories.sensuapp.org/apt/pubkey.gpg'
:key_source => 'https://repositories.sensuapp.org/apt/pubkey.gpg'
) }

it { should contain_package('uchiwa').with(
Expand Down