diff --git a/attributes/default.rb b/attributes/default.rb index d6e12375..f2a370e4 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -82,10 +82,6 @@ end # ============================= dnsmasq Configuration =================== # TODO: (jklare) this should be refactored and probably pull in the some dnsmasq # 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 # This will be used by dnsmasq to resolve recursively # but will not be used if the tenant specifies a dns @@ -108,7 +104,7 @@ default['openstack']['network_dhcp']['conf'].tap do |conf| end # ============================= 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 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 platform['neutron_packages'] = %w(openstack-neutron openstack-neutron-ml2 iproute) - platform['neutron_client_packages'] = - %w(python-neutronclient) platform['neutron_dhcp_packages'] = %w(openstack-neutron iproute) platform['neutron_l3_packages'] = @@ -262,8 +256,6 @@ default['openstack']['network']['platform'].tap do |platform| when 'debian' platform['neutron_packages'] = %w(neutron-common) - platform['neutron_client_packages'] = - %w(python-neutronclient python-pyparsing) platform['neutron_dhcp_packages'] = %w(neutron-dhcp-agent) platform['neutron_l3_packages'] = diff --git a/recipes/client.rb b/recipes/client.rb deleted file mode 100644 index bb1d2305..00000000 --- a/recipes/client.rb +++ /dev/null @@ -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 diff --git a/recipes/default.rb b/recipes/default.rb index ac25c984..d39b4ea9 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -20,8 +20,6 @@ # limitations under the License. # -include_recipe 'openstack-network::client' - require 'uri' # Make Openstack object available in Chef::Recipe diff --git a/recipes/dhcp_agent.rb b/recipes/dhcp_agent.rb index 6f676a3b..7a08f212 100644 --- a/recipes/dhcp_agent.rb +++ b/recipes/dhcp_agent.rb @@ -54,17 +54,8 @@ end # cookbook to do the proper configuration case node['platform'] when 'centos' - if node['platform_version'].to_f < 7.1 - dnsmasq_file = "#{Chef::Config[:file_cache_path]}/#{node['openstack']['network']['dnsmasq']['rpm_version']}" - 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 + rpm_package 'dnsmasq' do + action :upgrade end end diff --git a/spec/client-redhat_spec.rb b/spec/client-redhat_spec.rb deleted file mode 100644 index 273fbf1e..00000000 --- a/spec/client-redhat_spec.rb +++ /dev/null @@ -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 diff --git a/spec/client_spec.rb b/spec/client_spec.rb deleted file mode 100644 index 850b7641..00000000 --- a/spec/client_spec.rb +++ /dev/null @@ -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 diff --git a/spec/default_spec.rb b/spec/default_spec.rb index 29843f02..2162be1c 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -11,11 +11,7 @@ describe 'openstack-network' do include_context 'neutron-stubs' - it do - expect(chef_run).to include_recipe('openstack-network::client') - end - - %w(neutron-common python-pyparsing python-mysqldb).each do |package| + %w(neutron-common python-mysqldb).each do |package| it do expect(chef_run).to upgrade_package(package) end @@ -79,7 +75,7 @@ describe 'openstack-network' do .with_section_content('oslo_messaging_rabbit', /^rabbit_password = mq-pass/) 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 node.set['openstack']['network']['conf']['DEFAULT']['rpc_backend'] = 'not_rabbit' end @@ -94,9 +90,9 @@ describe 'openstack-network' do let(:file) { chef_run.template('/etc/neutron/neutron.conf') } [ %r{^log_dir = /var/log/neutron$}, + /^rpc_backend = rabbit$/, /^control_exchange = neutron$/, /^core_plugin = ml2$/, - /^rpc_backend = rabbit$/, /^bind_host = 127\.0\.0\.1$/, /^bind_port = 9696$/ ].each do |line| diff --git a/spec/dhcp_agent-centos_spec.rb b/spec/dhcp_agent-centos_spec.rb index 95d9583a..e0730d01 100644 --- a/spec/dhcp_agent-centos_spec.rb +++ b/spec/dhcp_agent-centos_spec.rb @@ -27,23 +27,14 @@ describe 'openstack-network::dhcp_agent' do expect(chef_run).to enable_service('neutron-dhcp-agent') end - it 'should have the correct dnsmasq remote file' 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') - 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") + it 'should install the dnsmasq rpm' do + expect(chef_run).to upgrade_rpm_package('dnsmasq') end it 'should notify dhcp agent to restart immediately' do expect(chef_run.rpm_package('dnsmasq')).to notify('service[neutron-dhcp-agent]').to(:restart).delayed 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 let(:file) { chef_run.template('/etc/neutron/dhcp_agent.ini') } diff --git a/spec/l3_agent_spec.rb b/spec/l3_agent_spec.rb index 35ff2c0b..087254bf 100644 --- a/spec/l3_agent_spec.rb +++ b/spec/l3_agent_spec.rb @@ -6,7 +6,7 @@ describe 'openstack-network::l3_agent' do let(:runner) { ChefSpec::SoloRunner.new(UBUNTU_OPTS) } let(:node) { runner.node } 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) end describe 'recipe' do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 49fdfffd..cb5ca822 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,12 +15,12 @@ REDHAT_OPTS = { }.freeze UBUNTU_OPTS = { platform: 'ubuntu', - version: '14.04', + version: '16.04', log_level: LOG_LEVEL }.freeze CENTOS_OPTS = { platform: 'centos', - version: '6.5', + version: '7.2.1511', log_level: LOG_LEVEL }.freeze