Support neutron-{api,rpc-server} services
In Debian, all is now Python 3. In such world, neutron-server doesn't work over SSL, because of Eventlet bugs/limitations. So instead of running neutron-server, we have to run neutron-api on top of mod_wsgi or on top of uwsgi. In such a setup, we need to run neutron-rpc-server, as the Neutron WSGI application doesn't do the AMQP jobs. Change-Id: I4926327c513e2c79f8fbe1563fa6a7e70683401b
This commit is contained in:
parent
0fd755588a
commit
8d65a81163
@ -11,7 +11,6 @@ class neutron::params {
|
||||
$pyvers = ''
|
||||
}
|
||||
$client_package = "python${pyvers}-neutronclient"
|
||||
$server_service = 'neutron-server'
|
||||
$ovs_agent_service = 'neutron-openvswitch-agent'
|
||||
$destroy_patch_ports_service = 'neutron-destroy-patch-ports'
|
||||
$linuxbridge_agent_service = 'neutron-linuxbridge-agent'
|
||||
@ -48,7 +47,12 @@ class neutron::params {
|
||||
if($::osfamily == 'Redhat') {
|
||||
$nobody_user_group = 'nobody'
|
||||
$package_name = 'openstack-neutron'
|
||||
$server_service = 'neutron-server'
|
||||
$server_package = false
|
||||
$api_package_name = false
|
||||
$api_service_name = false
|
||||
$rpc_package_name = false
|
||||
$rpc_service_name = false
|
||||
$ml2_server_package = 'openstack-neutron-ml2'
|
||||
$ovs_agent_package = false
|
||||
$ovs_server_package = 'openstack-neutron-openvswitch'
|
||||
@ -88,11 +92,22 @@ class neutron::params {
|
||||
} elsif($::osfamily == 'Debian') {
|
||||
$nobody_user_group = 'nogroup'
|
||||
$package_name = 'neutron-common'
|
||||
$server_package = 'neutron-server'
|
||||
if $::os_package_type =='debian' {
|
||||
$ml2_server_package = false
|
||||
$ml2_server_package = false
|
||||
$server_service = false
|
||||
$server_package = false
|
||||
$api_package_name = 'neutron-api'
|
||||
$api_service_name = 'neutron-api'
|
||||
$rpc_package_name = 'neutron-rpc-server'
|
||||
$rpc_service_name = 'neutron-rpc-server'
|
||||
} else {
|
||||
$ml2_server_package = 'neutron-plugin-ml2'
|
||||
$server_service = 'neutron-server'
|
||||
$server_package = 'neutron-server'
|
||||
$api_package_name = false
|
||||
$api_service_name = false
|
||||
$rpc_package_name = false
|
||||
$rpc_service_name = false
|
||||
}
|
||||
$ovs_agent_package = 'neutron-openvswitch-agent'
|
||||
$ovs_server_package = 'neutron-plugin-openvswitch'
|
||||
|
@ -19,12 +19,42 @@
|
||||
# [*service_name*]
|
||||
# (optional) Name of the service that will be providing the
|
||||
# server functionality of neutron-api.
|
||||
# If the value is 'httpd', this means neutron-api will be a web
|
||||
# If the value is 'httpd', this means neutron API will be a web
|
||||
# service, and you must use another class to configure that
|
||||
# web service. For example, use class { 'neutron::wsgi::apache'...}
|
||||
# to make neutron-api be a web app using apache mod_wsgi.
|
||||
# If set to false, then neutron-server isn't in use, and we will
|
||||
# be using neutron-api and neutron-rpc-server instead.
|
||||
# Defaults to '$::neutron::params::server_service'
|
||||
#
|
||||
# [*server_package*]
|
||||
# (optional) Name of the package holding neutron-server.
|
||||
# If service_name is set to false, then this also must be
|
||||
# set to false. With false, no package will be installed
|
||||
# before running the neutron-server service.
|
||||
# Defaults to '$::neutron::params::server_package'
|
||||
#
|
||||
# [*api_package_name*]
|
||||
# (optional) Name of the package holding neutron-api.
|
||||
# If this parameter is set to false,
|
||||
# Default to '$::neutron::params::api_package_name'
|
||||
#
|
||||
# [*api_service_name*]
|
||||
# (optional) Name of the service for neutron-api.
|
||||
# If service_name is set to false, this parameter must
|
||||
# be set with a value, so that an API server will run.
|
||||
# Defaults to '$::neutron::params::api_service_name'
|
||||
#
|
||||
# [*rpc_package_name*]
|
||||
# (optional) Name of the package for neutron-rpc-server.
|
||||
# Default to '$::neutron::params::rpc_package_name'
|
||||
#
|
||||
# [*rpc_service_name*]
|
||||
# (optional) Name of the service for the RPC listener.
|
||||
# If service_name is set to false, this parameter must
|
||||
# be set with a value, so that an RPC server will run.
|
||||
# Defaults to '$::neutron::params::rpc_service_name'
|
||||
#
|
||||
# [*validate*]
|
||||
# (optional) Whether to validate the service is working after any service refreshes
|
||||
# Defaults to false
|
||||
@ -235,6 +265,11 @@ class neutron::server (
|
||||
$enabled = true,
|
||||
$manage_service = true,
|
||||
$service_name = $::neutron::params::server_service,
|
||||
$server_package = $::neutron::params::server_package,
|
||||
$api_package_name = $::neutron::params::api_package_name,
|
||||
$api_service_name = $::neutron::params::api_service_name,
|
||||
$rpc_package_name = $::neutron::params::rpc_package_name,
|
||||
$rpc_service_name = $::neutron::params::rpc_service_name,
|
||||
$validate = false,
|
||||
$database_connection = undef,
|
||||
$database_max_retries = undef,
|
||||
@ -385,7 +420,7 @@ future release')
|
||||
|
||||
neutron_config { 'qos/notification_drivers': value => join(any2array($qos_notification_drivers), ',') }
|
||||
|
||||
if ($::neutron::params::server_package) {
|
||||
if $server_package {
|
||||
package { 'neutron-server':
|
||||
ensure => $package_ensure,
|
||||
name => $::neutron::params::server_package,
|
||||
@ -393,6 +428,22 @@ future release')
|
||||
}
|
||||
}
|
||||
|
||||
if $api_package_name {
|
||||
package { 'neutron-api':
|
||||
ensure => $package_ensure,
|
||||
name => $api_package_name,
|
||||
tag => ['openstack', 'neutron-package'],
|
||||
}
|
||||
}
|
||||
|
||||
if $rpc_package_name {
|
||||
package { 'neutron-rpc-server':
|
||||
ensure => $package_ensure,
|
||||
name => $rpc_package_name,
|
||||
tag => ['openstack', 'neutron-package'],
|
||||
}
|
||||
}
|
||||
|
||||
if ($auth_strategy == 'keystone') {
|
||||
|
||||
include ::neutron::keystone::authtoken
|
||||
@ -417,39 +468,70 @@ future release')
|
||||
$service_ensure = 'stopped'
|
||||
}
|
||||
}
|
||||
if $service_name == $::neutron::params::server_service {
|
||||
service { 'neutron-server':
|
||||
ensure => $service_ensure,
|
||||
name => $::neutron::params::server_service,
|
||||
enable => $enabled,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => ['neutron-service', 'neutron-db-sync-service', 'neutron-server-eventlet'],
|
||||
|
||||
# $service_name is the old 'neutron-server' service. If it is in use,
|
||||
# then we don't need to start neutron-api and neutron-rpc-server. If
|
||||
# it is not, then we must start neutron-api and neutron-rpc-server instead.
|
||||
if $service_name {
|
||||
if $service_name == $::neutron::params::server_service {
|
||||
service { 'neutron-server':
|
||||
ensure => $service_ensure,
|
||||
name => $::neutron::params::server_service,
|
||||
enable => $enabled,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => ['neutron-service', 'neutron-db-sync-service', 'neutron-server-eventlet'],
|
||||
}
|
||||
} elsif $service_name == 'httpd' {
|
||||
include ::apache::params
|
||||
service { 'neutron-server':
|
||||
ensure => 'stopped',
|
||||
name => $::neutron::params::server_service,
|
||||
enable => false,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => ['neutron-service', 'neutron-db-sync-service'],
|
||||
}
|
||||
Service <| title == 'httpd' |> { tag +> 'neutron-service' }
|
||||
# we need to make sure neutron-server is stopped before trying to start apache
|
||||
Service[$::neutron::params::server_service] -> Service[$service_name]
|
||||
} else {
|
||||
# backward compatibility so operators can customize the service name.
|
||||
service { 'neutron-server':
|
||||
ensure => $service_ensure,
|
||||
name => $service_name,
|
||||
enable => $enabled,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => ['neutron-service', 'neutron-db-sync-service'],
|
||||
}
|
||||
}
|
||||
} elsif $service_name == 'httpd' {
|
||||
include ::apache::params
|
||||
service { 'neutron-server':
|
||||
ensure => 'stopped',
|
||||
name => $::neutron::params::server_service,
|
||||
enable => false,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => ['neutron-service', 'neutron-db-sync-service'],
|
||||
}
|
||||
Service <| title == 'httpd' |> { tag +> 'neutron-service' }
|
||||
# we need to make sure neutron-server is stopped before trying to start apache
|
||||
Service[$::neutron::params::server_service] -> Service[$service_name]
|
||||
} else {
|
||||
# backward compatibility so operators can customize the service name.
|
||||
service { 'neutron-server':
|
||||
ensure => $service_ensure,
|
||||
name => $service_name,
|
||||
enable => $enabled,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => ['neutron-service', 'neutron-db-sync-service'],
|
||||
if $api_service_name {
|
||||
service { 'neutron-server':
|
||||
ensure => $service_ensure,
|
||||
name => $api_service_name,
|
||||
enable => $enabled,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => ['neutron-service', 'neutron-db-sync-service', 'neutron-server-eventlet'],
|
||||
}
|
||||
}
|
||||
|
||||
if $rpc_service_name {
|
||||
service { 'neutron-rpc-server':
|
||||
ensure => $service_ensure,
|
||||
name => $rpc_service_name,
|
||||
enable => $enabled,
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
tag => ['neutron-service', 'neutron-db-sync-service'],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# The service validation is required by Debian and Ubuntu, because the
|
||||
# server takes too much time to be fully up after the service starts.
|
||||
if $validate {
|
||||
$keystone_project_name = $::neutron::keystone::authtoken::project_name
|
||||
$keystone_username = $::neutron::keystone::authtoken::username
|
||||
|
Loading…
Reference in New Issue
Block a user