Add service_name parameter to neuron::server class

Allow for customizing the name of the neutron-server service.
The use case here is for organizations that build their own
OpenStack packages, and the service names may differ slightly
from the upstream distro defaults.

Change-Id: If539c51279a8a675e40e356fb4445b6324b75936
This commit is contained in:
Mike Dorman 2014-11-21 09:57:46 -07:00
parent 109abb2364
commit acce57da8b
3 changed files with 18 additions and 3 deletions

View File

@ -92,10 +92,10 @@ class neutron::keystone::auth (
$real_public_port = $public_port
}
Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| name == 'neutron-server' |>
Keystone_endpoint["${region}/${real_service_name}"] ~> Service <| title == 'neutron-server' |>
if $configure_user_role {
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| name == 'neutron-server' |>
Keystone_user_role["${auth_name}@${tenant}"] ~> Service <| title == 'neutron-server' |>
}
keystone::resource::service_identity { $auth_name:

View File

@ -16,6 +16,10 @@
# (optional) Whether to start/stop the service
# Defaults to true
#
# [*service_name*]
# (optional) The name of the neutron-server service
# Defaults to 'neutron-server'
#
# [*log_file*]
# REMOVED: Use log_file of neutron class instead.
#
@ -189,6 +193,7 @@ class neutron::server (
$package_ensure = 'present',
$enabled = true,
$manage_service = true,
$service_name = $::neutron::params::server_service,
$auth_password = false,
$auth_type = 'keystone',
$auth_host = 'localhost',
@ -388,7 +393,7 @@ class neutron::server (
service { 'neutron-server':
ensure => $service_ensure,
name => $::neutron::params::server_service,
name => $service_name,
enable => $enabled,
hasstatus => true,
hasrestart => true,

View File

@ -94,6 +94,7 @@ describe 'neutron::server' do
should contain_neutron_api_config('filter:authtoken/auth_admin_prefix').with(
:ensure => 'absent'
)
should contain_service('neutron-server').with_name('neutron-server')
should contain_neutron_config('DEFAULT/api_workers').with_value(facts[:processorcount])
should contain_neutron_config('DEFAULT/rpc_workers').with_value(facts[:processorcount])
should contain_neutron_config('DEFAULT/agent_down_time').with_value(p[:agent_down_time])
@ -152,6 +153,15 @@ describe 'neutron::server' do
expect { subject }.to raise_error(Puppet::Error, /min_l3_agents_per_router should be less than or equal to max_l3_agents_per_router./)
end
end
context 'with custom service name' do
before :each do
params.merge!(:service_name => 'custom-service-name')
end
it 'should configure proper service name' do
should contain_service('neutron-server').with_name('custom-service-name')
end
end
end
shared_examples_for 'a neutron server with auth_admin_prefix set' do