Install packages for services in service_plugins
When lbaas or vpnaas is enabled, we should make sure related packages are installed before neutron-server start, otherwise neutron-server will crash for could find plugin list in service_plugins. Change-Id: I8d5939dacd74496158932b658c3aec4d78ad1fe9 Closes-Bug: #1486390
This commit is contained in:
parent
77cdac6a0d
commit
b64ed92dc4
|
@ -70,6 +70,32 @@ node['openstack']['db']['python_packages'][db_type].each do |pkg|
|
|||
end
|
||||
end
|
||||
|
||||
# neutron-lbaas-agent may not running on network node, but on network node, neutron-server still need neutron_lbaas module
|
||||
# when loading plugin if lbaas is list in service_plugins. In this case, we don't need include balance recipe for network node, but
|
||||
# we need make sure neutron lbaas packages get installed on network ndoe before neutron-server start/restart, when lbaas is enabled.
|
||||
# Otherwise neutron-server will crash for couldn't find lbaas plugin when invoking plugins from service_plugins.
|
||||
platform_options['neutron_lb_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
only_if { [true, 'true', 'True'].include?(node['openstack']['network']['lbaas']['enabled']) && role_match }
|
||||
end
|
||||
end
|
||||
|
||||
# neutron-vpnaas-agent may not running on network node, but on network node, neutron-server still need neutron_vpnaas module
|
||||
# when loading plugin if vpnaas is list in service_plugins. In this case, we don't need include vpn_agent recipe for network node, but
|
||||
# we need make sure neutron vpnaas packages get installed on network node before neutron-server start/restart, when vpnaas is enabled.
|
||||
# Otherwise neutron-server will crash for couldn't find vpnaas plugin when invoking plugins from service_plugins.
|
||||
platform_options['neutron_vpn_packages'].each do |pkg|
|
||||
package pkg do
|
||||
options platform_options['package_overrides']
|
||||
action :upgrade
|
||||
# The vpn agent depends on l3_agent, and providers nicira, plumgrid, bigswitch, will not use the generic l3_agent. So if we are using
|
||||
# these providers, vpn agent will not get supported, and we should not install related packages here.
|
||||
only_if { node['openstack']['network']['enable_vpn'] && role_match && !['nicira', 'plumgrid', 'bigswitch'].include?(main_plugin) }
|
||||
end
|
||||
end
|
||||
|
||||
directory '/etc/neutron/plugins' do
|
||||
recursive true
|
||||
owner node['openstack']['network']['platform']['user']
|
||||
|
|
|
@ -417,6 +417,28 @@ describe 'openstack-network' do
|
|||
expect(chef_run).to upgrade_package('python-mysqldb')
|
||||
end
|
||||
|
||||
it 'does not upgrade python-neutron-lbaas when lbaas not enabled' do
|
||||
node.override['openstack']['network']['lbaas']['enabled'] = false
|
||||
expect(chef_run).to_not upgrade_package('python-neutron-lbaas')
|
||||
end
|
||||
|
||||
it 'upgrades python-neutron-lbaas on network node when lbaas enabled' do
|
||||
node.override['openstack']['network']['lbaas']['enabled'] = true
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:role_included?).with('os-network-server').and_return(true)
|
||||
expect(chef_run).to upgrade_package('python-neutron-lbaas')
|
||||
end
|
||||
|
||||
it 'does not upgrade python-neutron-vpnaas when vpnaas not enabled' do
|
||||
node.override['openstack']['network']['enable_vpn'] = false
|
||||
expect(chef_run).to_not upgrade_package('python-neutron-vpnaas')
|
||||
end
|
||||
|
||||
it 'upgrades python-neutron-vpnaas on network node when vpnaas enabled' do
|
||||
node.override['openstack']['network']['enable_vpn'] = true
|
||||
allow_any_instance_of(Chef::Recipe).to receive(:role_included?).with('os-network-server').and_return(true)
|
||||
expect(chef_run).to upgrade_package('python-neutron-vpnaas')
|
||||
end
|
||||
|
||||
describe 'neutron.conf' do
|
||||
let(:file) { chef_run.template('/etc/neutron/neutron.conf') }
|
||||
|
||||
|
|
Loading…
Reference in New Issue