Split apt_components for bare metal provisioning

The openstack-ppa.list file gets generated with an extra 'trusty'
resulting in a failed convergence on bare metal nodes.

Change-Id: Id34676333ecb383367e127557104bc134a9bfb1d
Closes-Bug: #1575613
This commit is contained in:
Samuel Cassiba 2016-04-28 13:08:02 -05:00
parent 02a140c221
commit 30e554a939
4 changed files with 7 additions and 11 deletions

View File

@ -125,9 +125,7 @@ default['openstack']['release'] = 'liberty'
default['openstack']['apt']['update_apt_cache'] = false
default['openstack']['apt']['live_updates_enabled'] = true
default['openstack']['apt']['uri'] = 'http://ubuntu-cloud.archive.canonical.com/ubuntu'
default['openstack']['apt']['components'] = ["#{node['lsb']['codename']}-updates/#{node['openstack']['release']}", 'main']
# For the SRU packaging, use this:
# default['openstack']['apt']['components'] = [ '%codename%-proposed/%release%', 'main' ]
default['openstack']['apt']['components'] = ['main']
default['openstack']['zypp']['repo-key'] = 'd85f9316' # 32 bit key ID
default['openstack']['zypp']['uri'] = 'http://download.opensuse.org/repositories/Cloud:/OpenStack:/%release%/%suse-release%/'

View File

@ -4,7 +4,7 @@ maintainer_email 'openstack-dev@lists.openstack.org'
license 'Apache 2.0'
description 'Common OpenStack attributes, libraries and recipes.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '12.0.0'
version '12.0.1'
recipe 'openstack-common', 'Installs/Configures common recipes'
recipe 'openstack-common::set_endpoints_by_interface', 'Set endpoints by interface'

View File

@ -32,13 +32,9 @@ when 'debian'
if node['openstack']['apt']['live_updates_enabled']
apt_components = node['openstack']['apt']['components']
# Simple variable substitution for LSB codename and OpenStack release
apt_components.each do |comp|
comp.gsub! '%release%', node['openstack']['release']
comp.gsub! '%codename%', node['lsb']['codename']
end
apt_repository 'openstack-ppa' do
uri node['openstack']['apt']['uri']
distribution "#{node['lsb']['codename']}-updates/#{node['openstack']['release']}"
components apt_components
end
end

View File

@ -29,14 +29,16 @@ describe 'openstack-common::default' do
node.set['openstack']['apt']['live_updates_enabled'] = true
expect(chef_run).to add_apt_repository('openstack-ppa').with(
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
components: ['trusty-updates/liberty', 'main'])
distribution: 'trusty-updates/liberty',
components: ['main'])
end
it 'disables openstack live updates' do
node.set['openstack']['apt']['live_updates_enabled'] = false
expect(chef_run).to_not add_apt_repository('openstack-ppa').with(
uri: 'http://ubuntu-cloud.archive.canonical.com/ubuntu',
components: ['trusty-updates/liberty', 'main'])
distribution: 'trusty-updates/liberty',
components: ['main'])
end
it 'does not install the gem chef-vault by default' do