From 13f29975a6605f505f97881d1c84a3b2aa8e5514 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 2 Sep 2015 13:41:21 -0400 Subject: [PATCH] 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 --- manifests/repo/debian/ubuntu.pp | 10 +++++++++- .../openstack_extras_repo_debian_ubuntu_spec.rb | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/manifests/repo/debian/ubuntu.pp b/manifests/repo/debian/ubuntu.pp index 346a73a..6c240e4 100644 --- a/manifests/repo/debian/ubuntu.pp +++ b/manifests/repo/debian/ubuntu.pp @@ -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, } } diff --git a/spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb b/spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb index 5bac4dd..7489b48 100644 --- a/spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb +++ b/spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb @@ -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