repo: use $ceph_mirror in ceph::repo

If $ceph_repo is set, let's use it when deploying SIG repo.
The feature was only available for Ubuntu until now. But we
could use it for CentOS too.

Thanks to this patch, the Puppet OpenStack CI will now deploy
Ceph repositories from AFS mirrors provided by OpenStack Infra.

Related-Bug: #1676421
Depends-On: Ica91b23c0954ccee17ea13903048b6133758f9f3

Change-Id: I840c0288e5ea15c74578d6468f55acf2456c3326
This commit is contained in:
Emilien Macchi 2017-03-27 12:31:28 -04:00
parent 0ab0f3f3a0
commit 2767d1ab7e
3 changed files with 30 additions and 2 deletions

View File

@ -124,9 +124,14 @@ class ceph::repo (
warning("CentOS SIG repository is only supported on CentOS operating system, \
not on ${::operatingsystem}, which can lead to packaging issues.")
}
if $ceph_mirror {
$ceph_mirror_real = $ceph_mirror
} else {
$ceph_mirror_real = "https://buildlogs.centos.org/centos/7/storage/x86_64/ceph-${release}/"
}
yumrepo { 'ceph-jewel-sig':
enabled => '1',
baseurl => 'https://buildlogs.centos.org/centos/7/storage/x86_64/ceph-jewel/',
baseurl => $ceph_mirror_real,
descr => 'Ceph Jewel SIG',
mirrorlist => 'absent',
gpgcheck => '0',

View File

@ -0,0 +1,4 @@
---
features:
- We can now deploy CentOS SIG repos from an external mirror
by re-using the $ceph_mirror parameter in ceph::repo.

View File

@ -547,7 +547,26 @@ describe 'ceph::repo' do
it { is_expected.to_not contain_yumrepo('ext-epel-7') }
it { is_expected.to_not contain_yumrepo('ext-ceph') }
it { is_expected.to_not contain_yumrepo('ext-ceph-noarch') }
it { is_expected.to contain_yumrepo('ceph-jewel-sig') }
it { is_expected.to contain_yumrepo('ceph-jewel-sig').with(
:baseurl => 'https://buildlogs.centos.org/centos/7/storage/x86_64/ceph-jewel/',
) }
end
describe "when using CentOS SIG repository from a mirror" do
let :params do
{
:enable_sig => true,
:ceph_mirror => 'https://mymirror/jewel/',
}
end
it { is_expected.to_not contain_file_line('exclude base') }
it { is_expected.to_not contain_yumrepo('ext-epel-7') }
it { is_expected.to_not contain_yumrepo('ext-ceph') }
it { is_expected.to_not contain_yumrepo('ext-ceph-noarch') }
it { is_expected.to contain_yumrepo('ceph-jewel-sig').with(
:baseurl => 'https://mymirror/jewel/',
) }
end
describe "with ensure => absent to disable" do