Ensure apt runs before packages are updated.
Previously on 12.04 this would attempt to update ubuntu-cloud-keyring and instantly fail when ran against vagrant images that hadn't done an apt-get update recently. Change-Id: I65f88668d7438f60aa741f4df032bd3040fa6a2b Closes-Bug: #1375443
This commit is contained in:
@@ -10,6 +10,7 @@ This file is used to list changes made in each version of cookbook-openstack-com
|
|||||||
* Make default using cinder v2 api
|
* Make default using cinder v2 api
|
||||||
* Add OS_VOLUME_API_VERSION for openrc
|
* Add OS_VOLUME_API_VERSION for openrc
|
||||||
* Removed the hardcoded PPA reference to "Precise"
|
* Removed the hardcoded PPA reference to "Precise"
|
||||||
|
* Added an optional automatic apt-get update for Debian based repos
|
||||||
|
|
||||||
## 10.1.0
|
## 10.1.0
|
||||||
* Adding identity admin bind host endpoint to allow flexibility and consistency
|
* Adding identity admin bind host endpoint to allow flexibility and consistency
|
||||||
|
@@ -108,6 +108,10 @@ default['openstack']['release'] = 'juno'
|
|||||||
# In the component strings, %codename% will be replaced by the value of
|
# In the component strings, %codename% will be replaced by the value of
|
||||||
# the node['lsb']['codename'] Ohai value and %release% will be replaced
|
# the node['lsb']['codename'] Ohai value and %release% will be replaced
|
||||||
# by the value of node['openstack']['release']
|
# by the value of node['openstack']['release']
|
||||||
|
#
|
||||||
|
# Change ['openstack']['apt']['update_apt_cache'] to true if you would like
|
||||||
|
# have the cache automaticly updated
|
||||||
|
default['openstack']['apt']['update_apt_cache'] = false
|
||||||
default['openstack']['apt']['live_updates_enabled'] = true
|
default['openstack']['apt']['live_updates_enabled'] = true
|
||||||
default['openstack']['apt']['uri'] = 'http://ubuntu-cloud.archive.canonical.com/ubuntu'
|
default['openstack']['apt']['uri'] = 'http://ubuntu-cloud.archive.canonical.com/ubuntu'
|
||||||
default['openstack']['apt']['components'] = ["#{node['lsb']['codename']}-updates/#{node['openstack']['release']}", 'main']
|
default['openstack']['apt']['components'] = ["#{node['lsb']['codename']}-updates/#{node['openstack']['release']}", 'main']
|
||||||
|
@@ -21,6 +21,10 @@
|
|||||||
platform_options = node['openstack']['common']['platform']
|
platform_options = node['openstack']['common']['platform']
|
||||||
case node['platform_family']
|
case node['platform_family']
|
||||||
when 'debian'
|
when 'debian'
|
||||||
|
if node['openstack']['apt']['update_apt_cache']
|
||||||
|
# Ensure we've done an apt-update first or packages won't be found.
|
||||||
|
include_recipe 'apt'
|
||||||
|
end
|
||||||
package 'ubuntu-cloud-keyring' do
|
package 'ubuntu-cloud-keyring' do
|
||||||
options platform_options['package_overrides']
|
options platform_options['package_overrides']
|
||||||
action :upgrade
|
action :upgrade
|
||||||
|
@@ -11,6 +11,15 @@ describe 'openstack-common::default' do
|
|||||||
runner.converge(described_recipe)
|
runner.converge(described_recipe)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'includes apt for apt-get update' do
|
||||||
|
node.set['openstack']['apt']['update_apt_cache'] = 'true'
|
||||||
|
expect(chef_run).to include_recipe 'apt'
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'doesnt include apt for apt-get update' do
|
||||||
|
expect(chef_run).to_not include_recipe 'apt'
|
||||||
|
end
|
||||||
|
|
||||||
it 'upgrades ubuntu-cloud-keyring package' do
|
it 'upgrades ubuntu-cloud-keyring package' do
|
||||||
expect(chef_run).to upgrade_package 'ubuntu-cloud-keyring'
|
expect(chef_run).to upgrade_package 'ubuntu-cloud-keyring'
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user