Trusty juno updates

* update spec platform versions
* remove dhcp build from source for precise

Change-Id: Id719f63650a01af8c60a6d91337718520d7d938d
Implements: blueprint trusty-juno
This commit is contained in:
Mark Vanderwiel 2015-02-02 16:41:01 -06:00
parent 91fef493e5
commit c565a5e4e8
4 changed files with 2 additions and 117 deletions

View File

@ -294,22 +294,6 @@ default['openstack']['network']['dhcp']['enable_metadata_network'] = 'False'
default['openstack']['network']['dhcp']['dnsmasq_rpm_source'] = "http://pkgs.repoforge.org/dnsmasq/dnsmasq-#{node['openstack']['network']['dhcp']['dnsmasq_rpm_version']}.rpm"
default['openstack']['network']['dhcp']['dnsmasq_rpm_version'] = '2.65-1.el6.rfx.x86_64'
# On ubuntu precise, we build dnsmasq from source to fetch a more recent
# version of dnsmasq since a backport is not available. For any other
# platform, dnsmasq will be installed as a package
#
# See https://lists.launchpad.net/openstack/msg11696.html
default['openstack']['network']['dhcp']['dnsmasq_url'] = 'https://codeload.github.com/guns/dnsmasq/tar.gz/v2.65'
# allow a wrapper to do this another way or use it's own package
default['openstack']['network']['dhcp']['dnsmasq_compile'] = true
# The name of the file we will fetch
default['openstack']['network']['dhcp']['dnsmasq_filename'] = 'v2.65.tar.gz'
# The checksum of the remote file we fetched
default['openstack']['network']['dhcp']['dnsmasq_checksum'] = 'f6cab8c64cb612089174f50927a05e2b'
# The package architecture that will be built which should match the
# archecture of the server this cookbook will run on which will be
# amd64 or i386
@ -1039,7 +1023,6 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
'neutron_packages' => ['openstack-neutron', 'openstack-neutron-ml2', 'iproute'],
'neutron_client_packages' => ['python-neutronclient'],
'neutron_dhcp_packages' => ['openstack-neutron', 'iproute'],
'neutron_dhcp_build_packages' => [],
'neutron_l3_packages' => ['openstack-neutron', 'iproute', 'radvd'],
'neutron_vpn_packages' => ['openstack-neutron', 'iproute'],
'vpn_device_driver_packages' => ['openswan'],
@ -1070,7 +1053,6 @@ when 'suse'
'neutron_packages' => ['openstack-neutron'],
'neutron_client_packages' => ['python-neutronclient'],
'neutron_dhcp_packages' => ['openstack-neutron-dhcp-agent'],
'neutron_dhcp_build_packages' => [],
'neutron_l3_packages' => ['openstack-neutron-l3-agent', 'radvd'],
'neutron_vpn_packages' => ['openstack-neutron-vpn-agent'],
'vpn_device_driver_packages' => ['openswan'],
@ -1103,7 +1085,6 @@ when 'debian'
'neutron_packages' => ['neutron-common', 'python-pyparsing', 'python-cliff'],
'neutron_client_packages' => ['python-neutronclient', 'python-pyparsing'],
'neutron_dhcp_packages' => ['neutron-dhcp-agent'],
'neutron_dhcp_build_packages' => %w(build-essential pkg-config libidn11-dev libdbus-1-dev libnetfilter-conntrack-dev gettext),
'neutron_l3_packages' => ['neutron-l3-agent', 'radvd'],
'neutron_vpn_packages' => ['neutron-vpn-agent'],
'vpn_device_driver_packages' => ['openswan'],

View File

@ -84,83 +84,3 @@ when 'centos'
end
end
end
# Deal with ubuntu precise dnsmasq 2.59 version by custom
# compiling a more recent version of dnsmasq
#
# See:
# https://lists.launchpad.net/openstack/msg11696.html
# https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1013529
# https://bugs.launchpad.net/ubuntu/+source/dnsmasq/+bug/1103357
# http://www.thekelleys.org.uk/dnsmasq/CHANGELOG (SO_BINDTODEVICE)
#
# Would prefer a PPA or backport but there are none and upstream
# has no plans to fix
if node['lsb'] && node['lsb']['codename'] == 'precise' && node['openstack']['network']['dhcp']['dnsmasq_compile'] == true
platform_options['neutron_dhcp_build_packages'].each do |pkg|
package pkg do
action :upgrade
end
end
dhcp_options = node['openstack']['network']['dhcp']
src_filename = dhcp_options['dnsmasq_filename']
src_filepath = "#{Chef::Config['file_cache_path']}/#{src_filename}"
extract_path = "#{Chef::Config['file_cache_path']}/#{dhcp_options['dnsmasq_checksum']}"
remote_file src_filepath do
source dhcp_options['dnsmasq_url']
checksum dhcp_options['dnsmasq_checksum']
owner 'root'
group 'root'
mode 00644
end
bash 'extract_package' do
cwd ::File.dirname(src_filepath)
code <<-EOH
mkdir -p #{extract_path}
tar xzf #{src_filename} -C #{extract_path}
mv #{extract_path}/*/* #{extract_path}/
cd #{extract_path}/
echo '2.65' > VERSION
debian/rules binary
EOH
not_if { ::File.exists?(extract_path) }
notifies :install, 'dpkg_package[dnsmasq-utils]', :immediately
notifies :install, 'dpkg_package[dnsmasq-base]', :immediately
notifies :install, 'dpkg_package[dnsmasq]', :immediately
end
# wait for dnsmasq to start properly. Don't wait forever
ruby_block 'wait for dnsmasq' do
block do
count = 5
counter = 0
while counter < count
run = Mixlib::ShellOut.new('dig +time=5 @localhost | grep -q root-server[s]').run_command
break unless run.exitstatus > 0
counter += 1
Chef::Log.fatal('dnsmasq never became ready') if counter == count
sleep 1
end
end
action :nothing
end
dpkg_package 'dnsmasq-utils' do
source "#{extract_path}/../dnsmasq-utils_#{dhcp_options['dnsmasq_dpkgversion']}_#{dhcp_options['dnsmasq_architecture']}.deb"
action :nothing
end
dpkg_package 'dnsmasq-base' do
source "#{extract_path}/../dnsmasq-base_#{dhcp_options['dnsmasq_dpkgversion']}_#{dhcp_options['dnsmasq_architecture']}.deb"
action :nothing
end
dpkg_package 'dnsmasq' do
source "#{extract_path}/../dnsmasq_#{dhcp_options['dnsmasq_dpkgversion']}_all.deb"
action :nothing
notifies :create, 'ruby_block[wait for dnsmasq]', :immediately
end
end

View File

@ -22,22 +22,6 @@ describe 'openstack-network::dhcp_agent' do
expect(chef_run.service('neutron-dhcp-agent')).to subscribe_to('template[/etc/neutron/neutron.conf]').delayed
end
# since our mocked version of ubuntu is precise, our compile
# utilities should be installed to build dnsmasq
it 'upgrades dnsmasq build dependencies' do
%w(build-essential pkg-config libidn11-dev libdbus-1-dev libnetfilter-conntrack-dev gettext).each do |pkg|
expect(chef_run).to upgrade_package pkg
end
end
it 'skips dnsmasq build when asked to' do
node.set['openstack']['network']['dhcp']['dnsmasq_compile'] = false
%w(build-essential pkg-config libidn11-dev libdbus-1-dev libnetfilter-conntrack-dev gettext).each do |pkg|
expect(chef_run).to_not upgrade_package pkg
end
end
it 'upgrades neutron dhcp package' do
expect(chef_run).to upgrade_package 'neutron-dhcp-agent'
end

View File

@ -14,12 +14,12 @@ SUSE_OPTS = {
}
REDHAT_OPTS = {
platform: 'redhat',
version: '6.5',
version: '7.0',
log_level: LOG_LEVEL
}
UBUNTU_OPTS = {
platform: 'ubuntu',
version: '12.04',
version: '14.04',
log_level: LOG_LEVEL
}
CENTOS_OPTS = {