Deprecate service validation for neutron-server

Following the past deprecation in puppet-keystone[1], this change
deprecates service validation for neutron-server.

[1] 3c95205e0253895e477b9135c10f5175d4166cfc

Depends-on: https://review.opendev.org/821585
Change-Id: I173e0d516aeccc61b836573b81141a5dcab6d825
This commit is contained in:
Takashi Kajinami 2021-12-13 23:33:27 +09:00
parent e4e61a9e4c
commit 35659b8d91
2 changed files with 18 additions and 28 deletions

View File

@ -55,10 +55,6 @@
# 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
#
# [*sync_db*]
# (Optional) Run neutron-db-manage on api nodes after installing the package.
# Defaults to false
@ -229,6 +225,12 @@
# mechanism driver for Neutron.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*validate*]
# (Optional) Whether to validate the service is working after any service refreshes
# Defaults to undef
#
class neutron::server (
$package_ensure = 'present',
$enabled = true,
@ -239,7 +241,6 @@ class neutron::server (
$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,
$sync_db = false,
$api_workers = $::os_workers,
$rpc_workers = $::os_workers,
@ -268,12 +269,18 @@ class neutron::server (
$max_request_body_size = $::os_service_default,
$ovs_integration_bridge = $::os_service_default,
$igmp_snooping_enable = $::os_service_default,
# DEPRECATED PARAMETERS
$validate = undef,
) inherits neutron::params {
include neutron::deps
include neutron::db
include neutron::policy
if $validate != undef {
warning('The neutron::server::validate parameter has been deprecated and has no effect')
}
if !is_service_default($default_availability_zones) {
validate_legacy(Array, 'validate_array', $default_availability_zones)
}
@ -482,27 +489,4 @@ class neutron::server (
}
}
}
# 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
$keystone_password = $::neutron::keystone::authtoken::password
$keystone_www_uri = $::neutron::keystone::authtoken::www_authenticate_uri
$validation_cmd = {
'neutron-server' => {
'environment' => ["OS_PASSWORD=${keystone_password}"],
# lint:ignore:140chars
'unless' => "openstack --os-auth-url ${keystone_www_uri} --os-project-name ${keystone_project_name} --os-username ${keystone_username} --os-identity-api-version 3 network list",
'command' => "openstack --os-auth-url ${keystone_www_uri} --os-project-name ${keystone_project_name} --os-username ${keystone_username} --os-identity-api-version 3 network list",
# lint:endignore
'timeout' => '60',
'tries' => '30',
'try_sleep' => '2',
}
}
create_resources('openstacklib::service_validation', $validation_cmd, {'subscribe' => 'Anchor[neutron::service::end]'})
}
}

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
The service validation feature of the ``neutron::server`` class is
deprecated, and the ``neutron::server::validate`` parameter has no effect
now.