repo/ubuntu: allow to change uca repo name

UCA proposes two kinds of repositories:
'proposed': not stable release but enough to be tested
'updates': considered as stable release (default)

'updates' is default to keep backward compatibility.
Using 'proposed' would be useful to test the current trunk release of
OpenStack if UCA is providing packages for it.

Change-Id: I827cbf9d8c8ebbf7d36084c3b2a828afee7f2797
This commit is contained in:
Emilien Macchi 2015-09-02 13:41:21 -04:00
parent 6f44d18446
commit 13f29975a6
2 changed files with 22 additions and 1 deletions

View File

@ -15,6 +15,13 @@
# Ubuntu Cloud Archive APT source
# Defaults to true
#
# [*repo*]
# (optional) Select with repository we want to use
# Can be 'updates' or 'proposed'
# 'proposed' to test upgrade to the next version
# 'updates' to install the latest stable version
# Defaults to 'updates'
#
# [*source_hash*]
# (optional) A hash of apt::source resources to
# create and manage
@ -33,6 +40,7 @@
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
@ -49,7 +57,7 @@ class openstack_extras::repo::debian::ubuntu(
}
apt::source { $::openstack_extras::repo::debian::params::uca_name:
location => $::openstack_extras::repo::debian::params::uca_location,
release => "${::lsbdistcodename}-updates/${release}",
release => "${::lsbdistcodename}-${repo}/${release}",
repos => $::openstack_extras::repo::debian::params::uca_repos,
}
}

View File

@ -128,5 +128,18 @@ describe 'openstack_extras::repo::debian::ubuntu' do
it { should contain_exec('installing ubuntu-cloud-keyring') }
end
describe 'with overridden uca repo name' do
let :params do
default_params.merge!({ :repo => 'proposed' })
end
it { should contain_apt__source('ubuntu-cloud-archive').with(
:location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
:release => 'trusty-proposed/kilo',
:repos => 'main',
)}
end
end
end