Deprecated python-neutronclient
- deprecated python-neutronclient references - removed deprecated references to repoforge; use OS-provided package for dnsmasq - removed neutron-client and client-packages Implements blueprint newton-xenial Change-Id: Idcb54b1ece38403dc4fc5dab758ddbdbab8ca968
This commit is contained in:
parent
3cc01d79ab
commit
f67ff76aae
|
@ -82,10 +82,6 @@ end
|
||||||
# ============================= dnsmasq Configuration ===================
|
# ============================= dnsmasq Configuration ===================
|
||||||
# TODO: (jklare) this should be refactored and probably pull in the some dnsmasq
|
# TODO: (jklare) this should be refactored and probably pull in the some dnsmasq
|
||||||
# cookbook to do the proper configuration
|
# cookbook to do the proper configuration
|
||||||
# the version of dnsmasq for centos 6.5 is two revs behind where the dhcp-agent needs
|
|
||||||
# to run properly. This is a version that allows and starts the dhcp-agent correctly.
|
|
||||||
default['openstack']['network']['dnsmasq']['rpm_version'] = '2.65-1.el6.rfx.x86_64'
|
|
||||||
default['openstack']['network']['dnsmasq']['rpm_source'] = "http://pkgs.repoforge.org/dnsmasq/dnsmasq-#{node['openstack']['network']['dnsmasq']['rpm_version']}.rpm"
|
|
||||||
# Upstream resolver to use
|
# Upstream resolver to use
|
||||||
# This will be used by dnsmasq to resolve recursively
|
# This will be used by dnsmasq to resolve recursively
|
||||||
# but will not be used if the tenant specifies a dns
|
# but will not be used if the tenant specifies a dns
|
||||||
|
@ -108,7 +104,7 @@ default['openstack']['network_dhcp']['conf'].tap do |conf|
|
||||||
end
|
end
|
||||||
|
|
||||||
# ============================= L3 Agent Configuration =====================
|
# ============================= L3 Agent Configuration =====================
|
||||||
default['openstack']['network_l3']['external_network_bridge_interface'] = 'eth1'
|
default['openstack']['network_l3']['external_network_bridge_interface'] = 'enp0s8'
|
||||||
|
|
||||||
# Customize the l3 config file path
|
# Customize the l3 config file path
|
||||||
default['openstack']['network_l3']['config_file'] = '/etc/neutron/l3_agent.ini'
|
default['openstack']['network_l3']['config_file'] = '/etc/neutron/l3_agent.ini'
|
||||||
|
@ -226,8 +222,6 @@ default['openstack']['network']['platform'].tap do |platform|
|
||||||
when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
|
when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this
|
||||||
platform['neutron_packages'] =
|
platform['neutron_packages'] =
|
||||||
%w(openstack-neutron openstack-neutron-ml2 iproute)
|
%w(openstack-neutron openstack-neutron-ml2 iproute)
|
||||||
platform['neutron_client_packages'] =
|
|
||||||
%w(python-neutronclient)
|
|
||||||
platform['neutron_dhcp_packages'] =
|
platform['neutron_dhcp_packages'] =
|
||||||
%w(openstack-neutron iproute)
|
%w(openstack-neutron iproute)
|
||||||
platform['neutron_l3_packages'] =
|
platform['neutron_l3_packages'] =
|
||||||
|
@ -262,8 +256,6 @@ default['openstack']['network']['platform'].tap do |platform|
|
||||||
when 'debian'
|
when 'debian'
|
||||||
platform['neutron_packages'] =
|
platform['neutron_packages'] =
|
||||||
%w(neutron-common)
|
%w(neutron-common)
|
||||||
platform['neutron_client_packages'] =
|
|
||||||
%w(python-neutronclient python-pyparsing)
|
|
||||||
platform['neutron_dhcp_packages'] =
|
platform['neutron_dhcp_packages'] =
|
||||||
%w(neutron-dhcp-agent)
|
%w(neutron-dhcp-agent)
|
||||||
platform['neutron_l3_packages'] =
|
platform['neutron_l3_packages'] =
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
# encoding: UTF-8
|
|
||||||
#
|
|
||||||
# Cookbook Name:: openstack-network
|
|
||||||
# Recipe:: client
|
|
||||||
#
|
|
||||||
# Copyright 2014, IBM Corp.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
# Make Openstack object available in Chef::Recipe
|
|
||||||
class ::Chef::Recipe
|
|
||||||
include ::Openstack
|
|
||||||
end
|
|
||||||
|
|
||||||
platform_options = node['openstack']['network']['platform']
|
|
||||||
platform_options['neutron_client_packages'].each do |pkg|
|
|
||||||
package pkg do
|
|
||||||
options platform_options['package_overrides']
|
|
||||||
action :upgrade
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -20,8 +20,6 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
include_recipe 'openstack-network::client'
|
|
||||||
|
|
||||||
require 'uri'
|
require 'uri'
|
||||||
|
|
||||||
# Make Openstack object available in Chef::Recipe
|
# Make Openstack object available in Chef::Recipe
|
||||||
|
|
|
@ -54,17 +54,8 @@ end
|
||||||
# cookbook to do the proper configuration
|
# cookbook to do the proper configuration
|
||||||
case node['platform']
|
case node['platform']
|
||||||
when 'centos'
|
when 'centos'
|
||||||
if node['platform_version'].to_f < 7.1
|
rpm_package 'dnsmasq' do
|
||||||
dnsmasq_file = "#{Chef::Config[:file_cache_path]}/#{node['openstack']['network']['dnsmasq']['rpm_version']}"
|
action :upgrade
|
||||||
remote_file dnsmasq_file do
|
|
||||||
source node['openstack']['network']['dnsmasq']['rpm_source']
|
|
||||||
not_if { ::File.exist?(dnsmasq_file) || node['openstack']['network']['dnsmasq']['rpm_version'].to_s.empty? }
|
|
||||||
end
|
|
||||||
rpm_package 'dnsmasq' do
|
|
||||||
source dnsmasq_file
|
|
||||||
action :install
|
|
||||||
not_if { node['openstack']['network']['dnsmasq']['rpm_version'].to_s.empty? }
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
# encoding: UTF-8
|
|
||||||
require_relative 'spec_helper'
|
|
||||||
|
|
||||||
describe 'openstack-network::client' do
|
|
||||||
describe 'redhat' do
|
|
||||||
let(:runner) { ChefSpec::SoloRunner.new(REDHAT_OPTS) }
|
|
||||||
let(:node) { runner.node }
|
|
||||||
let(:chef_run) do
|
|
||||||
runner.converge(described_recipe)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'upgrades python neutron client package' do
|
|
||||||
expect(chef_run).to upgrade_package('python-neutronclient')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,16 +0,0 @@
|
||||||
require_relative 'spec_helper'
|
|
||||||
|
|
||||||
describe 'openstack-network::client' do
|
|
||||||
describe 'ubuntu' do
|
|
||||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
|
||||||
let(:node) { runner.node }
|
|
||||||
let(:chef_run) do
|
|
||||||
runner.converge(described_recipe)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'upgrades python neutron client package' do
|
|
||||||
expect(chef_run).to upgrade_package('python-neutronclient')
|
|
||||||
expect(chef_run).to upgrade_package('python-pyparsing')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -11,11 +11,7 @@ describe 'openstack-network' do
|
||||||
|
|
||||||
include_context 'neutron-stubs'
|
include_context 'neutron-stubs'
|
||||||
|
|
||||||
it do
|
%w(neutron-common python-mysqldb).each do |package|
|
||||||
expect(chef_run).to include_recipe('openstack-network::client')
|
|
||||||
end
|
|
||||||
|
|
||||||
%w(neutron-common python-pyparsing python-mysqldb).each do |package|
|
|
||||||
it do
|
it do
|
||||||
expect(chef_run).to upgrade_package(package)
|
expect(chef_run).to upgrade_package(package)
|
||||||
end
|
end
|
||||||
|
@ -79,7 +75,7 @@ describe 'openstack-network' do
|
||||||
.with_section_content('oslo_messaging_rabbit', /^rabbit_password = mq-pass/)
|
.with_section_content('oslo_messaging_rabbit', /^rabbit_password = mq-pass/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
describe 'has no rabbit values if rpc_backend is not default' do
|
describe 'has no rabbit value if rpc_backend is not default' do
|
||||||
before do
|
before do
|
||||||
node.set['openstack']['network']['conf']['DEFAULT']['rpc_backend'] = 'not_rabbit'
|
node.set['openstack']['network']['conf']['DEFAULT']['rpc_backend'] = 'not_rabbit'
|
||||||
end
|
end
|
||||||
|
@ -94,9 +90,9 @@ describe 'openstack-network' do
|
||||||
let(:file) { chef_run.template('/etc/neutron/neutron.conf') }
|
let(:file) { chef_run.template('/etc/neutron/neutron.conf') }
|
||||||
[
|
[
|
||||||
%r{^log_dir = /var/log/neutron$},
|
%r{^log_dir = /var/log/neutron$},
|
||||||
|
/^rpc_backend = rabbit$/,
|
||||||
/^control_exchange = neutron$/,
|
/^control_exchange = neutron$/,
|
||||||
/^core_plugin = ml2$/,
|
/^core_plugin = ml2$/,
|
||||||
/^rpc_backend = rabbit$/,
|
|
||||||
/^bind_host = 127\.0\.0\.1$/,
|
/^bind_host = 127\.0\.0\.1$/,
|
||||||
/^bind_port = 9696$/
|
/^bind_port = 9696$/
|
||||||
].each do |line|
|
].each do |line|
|
||||||
|
|
|
@ -27,23 +27,14 @@ describe 'openstack-network::dhcp_agent' do
|
||||||
expect(chef_run).to enable_service('neutron-dhcp-agent')
|
expect(chef_run).to enable_service('neutron-dhcp-agent')
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should have the correct dnsmasq remote file' do
|
it 'should install the dnsmasq rpm' do
|
||||||
expect(chef_run).to create_remote_file("#{Chef::Config[:file_cache_path]}/2.65-1.el6.rfx.x86_64").with(source: 'http://pkgs.repoforge.org/dnsmasq/dnsmasq-2.65-1.el6.rfx.x86_64.rpm')
|
expect(chef_run).to upgrade_rpm_package('dnsmasq')
|
||||||
end
|
|
||||||
|
|
||||||
it 'should install the corrcet dnsmasq rpm' do
|
|
||||||
expect(chef_run).to install_rpm_package('dnsmasq').with(source: "#{Chef::Config[:file_cache_path]}/2.65-1.el6.rfx.x86_64")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should notify dhcp agent to restart immediately' do
|
it 'should notify dhcp agent to restart immediately' do
|
||||||
expect(chef_run.rpm_package('dnsmasq')).to notify('service[neutron-dhcp-agent]').to(:restart).delayed
|
expect(chef_run.rpm_package('dnsmasq')).to notify('service[neutron-dhcp-agent]').to(:restart).delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not have the correct dnsmasq remote file when no version' do
|
|
||||||
node.set['openstack']['network']['dnsmasq']['rpm_version'] = ''
|
|
||||||
expect(chef_run).not_to create_remote_file("#{Chef::Config[:file_cache_path]}/2.65-1.el6.rfx.x86_64")
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '/etc/neutron/dhcp_agent.ini' do
|
describe '/etc/neutron/dhcp_agent.ini' do
|
||||||
let(:file) { chef_run.template('/etc/neutron/dhcp_agent.ini') }
|
let(:file) { chef_run.template('/etc/neutron/dhcp_agent.ini') }
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ describe 'openstack-network::l3_agent' do
|
||||||
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) }
|
||||||
let(:node) { runner.node }
|
let(:node) { runner.node }
|
||||||
let(:chef_run) do
|
let(:chef_run) do
|
||||||
node.set['openstack']['network_l3']['external_network_bridge_interface'] = 'eth1'
|
node.set['openstack']['network_l3']['external_network_bridge_interface'] = 'enp0s8'
|
||||||
runner.converge(described_recipe)
|
runner.converge(described_recipe)
|
||||||
end
|
end
|
||||||
describe 'recipe' do
|
describe 'recipe' do
|
||||||
|
|
|
@ -15,12 +15,12 @@ REDHAT_OPTS = {
|
||||||
}.freeze
|
}.freeze
|
||||||
UBUNTU_OPTS = {
|
UBUNTU_OPTS = {
|
||||||
platform: 'ubuntu',
|
platform: 'ubuntu',
|
||||||
version: '14.04',
|
version: '16.04',
|
||||||
log_level: LOG_LEVEL
|
log_level: LOG_LEVEL
|
||||||
}.freeze
|
}.freeze
|
||||||
CENTOS_OPTS = {
|
CENTOS_OPTS = {
|
||||||
platform: 'centos',
|
platform: 'centos',
|
||||||
version: '6.5',
|
version: '7.2.1511',
|
||||||
log_level: LOG_LEVEL
|
log_level: LOG_LEVEL
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue