Add possibility to change UCA repository
Instead of forcing 'updates' UCA repo, leaves possibility to the operator to choose which UCA he wants for pulling packages Change-Id: I3e47f8a8b280d1dfe29229e1f9905ad7c71c204d
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
# Ubuntu Cloud Archive repo (supports either Folsom or Grizzly)
|
# Ubuntu Cloud Archive repo (supports either Folsom or Grizzly)
|
||||||
class openstack::repo::uca(
|
class openstack::repo::uca(
|
||||||
$release = 'grizzly'
|
$release = 'grizzly',
|
||||||
|
$repo = 'updates'
|
||||||
) {
|
) {
|
||||||
if ($::operatingsystem == 'Ubuntu' and
|
if ($::operatingsystem == 'Ubuntu' and
|
||||||
$::lsbdistdescription =~ /^.*LTS.*$/) {
|
$::lsbdistdescription =~ /^.*LTS.*$/) {
|
||||||
@@ -8,7 +9,7 @@ class openstack::repo::uca(
|
|||||||
|
|
||||||
apt::source { 'ubuntu-cloud-archive':
|
apt::source { 'ubuntu-cloud-archive':
|
||||||
location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
location => 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
|
||||||
release => "${::lsbdistcodename}-updates/${release}",
|
release => "${::lsbdistcodename}-${repo}/${release}",
|
||||||
repos => 'main',
|
repos => 'main',
|
||||||
required_packages => 'ubuntu-cloud-keyring',
|
required_packages => 'ubuntu-cloud-keyring',
|
||||||
}
|
}
|
||||||
|
45
spec/classes/openstack_repo_uca_spec.rb
Normal file
45
spec/classes/openstack_repo_uca_spec.rb
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'openstack::repo::uca' do
|
||||||
|
|
||||||
|
describe 'Ubuntu with defaults' do
|
||||||
|
|
||||||
|
let :facts do
|
||||||
|
{
|
||||||
|
:osfamily => 'Debian',
|
||||||
|
:operatingsystem => 'Ubuntu',
|
||||||
|
:operatingsystemrelease => '12.04',
|
||||||
|
:lsbdistdescription => 'Ubuntu 12.04.1 LTS',
|
||||||
|
:lsbdistcodename => 'precise',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
it do
|
||||||
|
should contain_apt__source('ubuntu-cloud-archive').with(
|
||||||
|
:release => 'precise-updates/grizzly'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
describe 'Ubuntu and grizzly' do
|
||||||
|
let :params do
|
||||||
|
{ :release => 'folsom', :repo => 'proposed' }
|
||||||
|
end
|
||||||
|
|
||||||
|
let :facts do
|
||||||
|
{
|
||||||
|
:osfamily => 'Debian',
|
||||||
|
:operatingsystem => 'Ubuntu',
|
||||||
|
:operatingsystemrelease => '12.04',
|
||||||
|
:lsbdistdescription => 'Ubuntu 12.04.1 LTS',
|
||||||
|
:lsbdistcodename => 'precise',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it do
|
||||||
|
should contain_apt__source('ubuntu-cloud-archive').with(
|
||||||
|
:release => 'precise-proposed/folsom'
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Reference in New Issue
Block a user