Expose uca_location to override mirror location

Change-Id: I0cfd805a638388f36bafacd4bddaba5c28c63e6b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2016-06-28 11:48:53 -04:00 committed by Emilien Macchi
parent 7c15f3039f
commit ff76ef266a
3 changed files with 13 additions and 4 deletions

View File

@ -37,13 +37,18 @@
# installing any packages.
# Defaults to false
#
# [*uca_location*]
# (optional) Ubuntu Cloud Archives repository location.
# Defaults to $::openstack_extras::repo::debian::params::uca_location
#
class openstack_extras::repo::debian::ubuntu(
$release = $::openstack_extras::repo::debian::params::release,
$manage_uca = true,
$repo = 'updates',
$source_hash = {},
$source_defaults = {},
$package_require = false
$package_require = false,
$uca_location = $::openstack_extras::repo::debian::params::uca_location,
) inherits openstack_extras::repo::debian::params {
if $manage_uca {
exec { 'installing ubuntu-cloud-keyring':
@ -56,7 +61,7 @@ class openstack_extras::repo::debian::ubuntu(
notify => Exec['apt_update'],
}
apt::source { $::openstack_extras::repo::debian::params::uca_name:
location => $::openstack_extras::repo::debian::params::uca_location,
location => $uca_location,
release => "${::lsbdistcodename}-${repo}/${release}",
repos => $::openstack_extras::repo::debian::params::uca_repos,
}

View File

@ -0,0 +1,3 @@
---
features:
- When deploying UCA repositories, allow to customize the URL.

View File

@ -131,11 +131,12 @@ describe 'openstack_extras::repo::debian::ubuntu' do
describe 'with overridden uca repo name' do
let :params do
default_params.merge!({ :repo => 'proposed' })
default_params.merge!({ :repo => 'proposed',
:uca_location => 'http://mirror.dfw.rax.openstack.org/ubuntu-cloud-archive' })
end
it { is_expected.to contain_apt__source('ubuntu-cloud-archive').with(
:location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
:location => 'http://mirror.dfw.rax.openstack.org/ubuntu-cloud-archive',
:release => 'trusty-proposed/mitaka',
:repos => 'main',
)}