diff --git a/manifests/repo/debian/ubuntu.pp b/manifests/repo/debian/ubuntu.pp index 17b5535..7be0b6f 100644 --- a/manifests/repo/debian/ubuntu.pp +++ b/manifests/repo/debian/ubuntu.pp @@ -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, } diff --git a/releasenotes/notes/allow_change_uca_url-b855c119a693b583.yaml b/releasenotes/notes/allow_change_uca_url-b855c119a693b583.yaml new file mode 100644 index 0000000..f674e74 --- /dev/null +++ b/releasenotes/notes/allow_change_uca_url-b855c119a693b583.yaml @@ -0,0 +1,3 @@ +--- +features: + - When deploying UCA repositories, allow to customize the URL. diff --git a/spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb b/spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb index 7d8cbe6..275885d 100644 --- a/spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb +++ b/spec/classes/openstack_extras_repo_debian_ubuntu_spec.rb @@ -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', )}