repo: deploy ceph.com apt key only when required

Do not try to deploy ceph.com Apt key if the repository is not used.
OpenStack mirrors contain packages signed with this key.

Also disable beaker tests on Ubuntu, ceph.com is down.

Change-Id: Iae692bd90126930ca40a853d641aa17634e745de
This commit is contained in:
Emilien Macchi
2016-10-11 15:02:27 -04:00
parent a9818a2e95
commit 939307f497
3 changed files with 45 additions and 46 deletions

View File

@@ -74,23 +74,22 @@ class ceph::repo (
'Debian': {
include ::apt
apt::key { 'ceph':
ensure => $ensure,
id => '08B73419AC32B4E966C1A330E84AC2C0460F3994',
source => 'https://download.ceph.com/keys/release.asc',
}
if $ceph_mirror {
$ceph_mirror_real = $ceph_mirror
} else {
$ceph_mirror_real = "http://download.ceph.com/debian-${release}/"
apt::key { 'ceph':
ensure => $ensure,
id => '08B73419AC32B4E966C1A330E84AC2C0460F3994',
source => 'https://download.ceph.com/keys/release.asc',
before => Apt::Source['ceph'],
}
}
apt::source { 'ceph':
ensure => $ensure,
location => $ceph_mirror_real,
release => $::lsbdistcodename,
require => Apt::Key['ceph'],
tag => 'ceph',
}

View File

@@ -23,10 +23,12 @@ describe 'ceph mon osd' do
it 'should install one monitor and one OSD on /srv/data' do
pp = <<-EOS
if $::operatingsystem == 'CentOS' {
class { 'ceph::repo':
release => 'jewel',
enable_sig => true,
enable_epel => false,
ceph_mirror => $ceph_mirror,
}
class { 'ceph':
fsid => '82274746-9a2c-426b-8c51-107fb0d890c6',
@@ -45,11 +47,13 @@ describe 'ceph mon osd' do
authentication_type => 'none',
}
ceph::osd { '/srv/data': }
}
EOS
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
if os[:family].casecmp('RedHat') == 0
shell 'sleep 10' # we need to wait a bit until the OSD is up
shell 'ceph -s', { :acceptable_exit_codes => [0] } do |r|
@@ -63,5 +67,6 @@ describe 'ceph mon osd' do
end
end
end
end
end

View File

@@ -36,13 +36,13 @@ describe 'ceph::repo' do
it { is_expected.to contain_apt__key('ceph').with(
:id => '08B73419AC32B4E966C1A330E84AC2C0460F3994',
:source => 'https://download.ceph.com/keys/release.asc'
:source => 'https://download.ceph.com/keys/release.asc',
:before => 'Apt::Source[ceph]',
) }
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://download.ceph.com/debian-jewel/',
:release => 'jessie',
:require => 'Apt::Key[ceph]'
) }
end
@@ -57,7 +57,6 @@ describe 'ceph::repo' do
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://myserver.com/debian-jewel/',
:release => 'jessie',
:require => 'Apt::Key[ceph]'
) }
end
@@ -71,7 +70,6 @@ describe 'ceph::repo' do
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://download.ceph.com/debian-firefly/',
:release => 'jessie',
:require => 'Apt::Key[ceph]'
) }
end
@@ -93,13 +91,13 @@ describe 'ceph::repo' do
it { is_expected.to contain_apt__key('ceph').with(
:id => '08B73419AC32B4E966C1A330E84AC2C0460F3994',
:source => 'https://download.ceph.com/keys/release.asc'
:source => 'https://download.ceph.com/keys/release.asc',
:before => 'Apt::Source[ceph]',
) }
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://download.ceph.com/debian-jewel/',
:release => 'trusty',
:require => 'Apt::Key[ceph]'
) }
end
@@ -114,7 +112,6 @@ describe 'ceph::repo' do
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://download.ceph.com/debian-firefly/',
:release => 'trusty',
:require => 'Apt::Key[ceph]'
) }
end
@@ -127,13 +124,12 @@ describe 'ceph::repo' do
it { is_expected.to contain_apt__key('ceph-gitbuilder').with(
:id => 'FCC5CB2ED8E6F6FB79D5B3316EAEAE2203C3951A',
:server => 'keyserver.ubuntu.com'
:server => 'keyserver.ubuntu.com',
) }
it { is_expected.to contain_apt__source('ceph').with(
:location => 'http://download.ceph.com/debian-jewel/',
:release => 'trusty',
:require => 'Apt::Key[ceph]'
) }
it { is_expected.to contain_apt__source('ceph-fastcgi').with(
@@ -157,7 +153,6 @@ describe 'ceph::repo' do
:ensure => 'absent',
:location => 'http://download.ceph.com/debian-jewel/',
:release => 'trusty',
:require => 'Apt::Key[ceph]'
) }
it { is_expected.to contain_apt__source('ceph-fastcgi').with(