diff --git a/CHANGELOG.md b/CHANGELOG.md index 345ee813..083e2cdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ This file is used to list changes made in each version of cookbook-openstack-network. +## 8.1.0 +* Add client recipe + ## 8.0.1: * Add network database migration * Remove unneeded and redundant rhel setup script calls diff --git a/README.md b/README.md index 3a635f4e..8368d869 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,11 @@ The following cookbooks are dependencies: Recipes ======= +client +------ + +- Install the network client packages + server ------ diff --git a/attributes/default.rb b/attributes/default.rb index aa186ee4..2b2ccf48 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -766,7 +766,7 @@ when 'fedora', 'redhat', 'centos' # :pragma-foodcritic: ~FC024 - won't fix this 'postgresql_python_packages' => ['python-psycopg2'], 'nova_network_packages' => ['openstack-nova-network'], 'neutron_packages' => ['openstack-neutron'], - 'neutron_client_packages' => [], + 'neutron_client_packages' => ['python-neutronclient'], 'neutron_dhcp_packages' => ['openstack-neutron'], 'neutron_dhcp_build_packages' => [], 'neutron_l3_packages' => ['openstack-neutron'], @@ -793,7 +793,7 @@ when 'suse' 'postgresql_python_packages' => ['python-psycopg2'], 'nova_network_packages' => ['openstack-nova-network'], 'neutron_packages' => ['openstack-neutron'], - 'neutron_client_packages' => [], + 'neutron_client_packages' => ['python-neutronclient'], 'neutron_dhcp_packages' => ['openstack-neutron-dhcp-agent'], 'neutron_dhcp_build_packages' => [], 'neutron_l3_packages' => ['openstack-neutron-l3-agent'], diff --git a/metadata.rb b/metadata.rb index 4e65a3e7..bba3f2aa 100644 --- a/metadata.rb +++ b/metadata.rb @@ -5,7 +5,8 @@ maintainer 'Jay Pipes ' license 'Apache 2.0' description 'Installs and configures the OpenStack Network API Service and various agents and plugins' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '8.0.1' +version '8.1.0' +recipe 'openstack-network::client', 'Install packages required for network client' recipe 'openstack-network::server', 'Installs packages required for a OpenStack Network server' recipe 'openstack-network::openvswitch', 'Installs packages required for OVS' recipe 'openstack-network::metadata_agent', 'Installs packages required for a OpenStack Network Metadata Agent' diff --git a/recipes/client.rb b/recipes/client.rb new file mode 100644 index 00000000..1369e336 --- /dev/null +++ b/recipes/client.rb @@ -0,0 +1,32 @@ +# 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. +# + +class ::Chef::Recipe # rubocop:disable Documentation + 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/spec/client-redhat_spec.rb b/spec/client-redhat_spec.rb new file mode 100644 index 00000000..43ac3e0e --- /dev/null +++ b/spec/client-redhat_spec.rb @@ -0,0 +1,18 @@ +# encoding: UTF-8 +require_relative 'spec_helper' + +describe 'openstack-network::client' do + + describe 'redhat' do + + let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) } + let(:node) { runner.node } + let(:chef_run) do + runner.converge(described_recipe) + end + + it 'installs packages' do + expect(chef_run).to upgrade_package('python-neutronclient') + end + end +end diff --git a/spec/client_spec.rb b/spec/client_spec.rb new file mode 100644 index 00000000..6c147e9b --- /dev/null +++ b/spec/client_spec.rb @@ -0,0 +1,19 @@ +# encoding: UTF-8 +require_relative 'spec_helper' + +describe 'openstack-network::client' do + + describe 'ubuntu' do + + let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) } + let(:node) { runner.node } + let(:chef_run) do + runner.converge(described_recipe) + end + + it 'installs packages' do + expect(chef_run).to upgrade_package('python-neutronclient') + expect(chef_run).to upgrade_package('python-pyparsing') + end + end +end