replace validate_legacy with proper data types

the validate_legacy function is marked for deprecation in
v9.0.0 from puppetlabs-stdlib.

This also adds validations about some boolean parameters.

Change-Id: I57e0321eab18b66c00e364bb3b4346bb06591286
This commit is contained in:
Takashi Kajinami 2023-06-21 07:20:36 +09:00
parent bc209cda05
commit 1f273d3b4e
9 changed files with 39 additions and 47 deletions

View File

@ -104,25 +104,25 @@
# Defaults to $facts['os_service_default'].
#
class trove::api(
$manage_service = true,
$service_name = $::trove::params::api_service_name,
$package_ensure = 'present',
$bind_host = $facts['os_service_default'],
$bind_port = $facts['os_service_default'],
$backlog = $facts['os_service_default'],
$workers = $facts['os_workers'],
$enabled = true,
$purge_config = false,
$cert_file = false,
$key_file = false,
$ca_file = false,
$http_get_rate = $facts['os_service_default'],
$http_post_rate = $facts['os_service_default'],
$http_put_rate = $facts['os_service_default'],
$http_delete_rate = $facts['os_service_default'],
$http_mgmt_post_rate = $facts['os_service_default'],
$auth_strategy = 'keystone',
$taskmanager_queue = $facts['os_service_default'],
Boolean $manage_service = true,
$service_name = $::trove::params::api_service_name,
$package_ensure = 'present',
$bind_host = $facts['os_service_default'],
$bind_port = $facts['os_service_default'],
$backlog = $facts['os_service_default'],
$workers = $facts['os_workers'],
Boolean $enabled = true,
$purge_config = false,
$cert_file = false,
$key_file = false,
$ca_file = false,
$http_get_rate = $facts['os_service_default'],
$http_post_rate = $facts['os_service_default'],
$http_put_rate = $facts['os_service_default'],
$http_delete_rate = $facts['os_service_default'],
$http_mgmt_post_rate = $facts['os_service_default'],
$auth_strategy = 'keystone',
$taskmanager_queue = $facts['os_service_default'],
) inherits trove::params {
include trove::deps

View File

@ -33,13 +33,13 @@
# Default: $facts['os_service_default']
#
class trove::conductor(
$enabled = true,
$manage_service = true,
$package_ensure = 'present',
$conductor_manager = 'trove.conductor.manager.Manager',
$workers = $facts['os_workers'],
$enable_profiler = $facts['os_service_default'],
$trace_sqlalchemy = $facts['os_service_default'],
Boolean $enabled = true,
Boolean $manage_service = true,
$package_ensure = 'present',
$conductor_manager = 'trove.conductor.manager.Manager',
$workers = $facts['os_workers'],
$enable_profiler = $facts['os_service_default'],
$trace_sqlalchemy = $facts['os_service_default'],
) {
include trove::deps

View File

@ -52,17 +52,13 @@
# or Puppet catalog compilation will fail with duplicate resources.
#
class trove::config (
$trove_config = {},
$trove_guestagent_config = {},
$trove_api_paste_ini = {},
Hash $trove_config = {},
Hash $trove_guestagent_config = {},
Hash $trove_api_paste_ini = {},
) {
include trove::deps
validate_legacy(Hash, 'validate_hash', $trove_config)
validate_legacy(Hash, 'validate_hash', $trove_guestagent_config)
validate_legacy(Hash, 'validate_hash', $trove_api_paste_ini)
create_resources('trove_config', $trove_config)
create_resources('trove_guestagent_config', $trove_guestagent_config)
create_resources('trove_api_paste_ini', $trove_api_paste_ini)

View File

@ -50,7 +50,7 @@
# Defaults 'utf8_general_ci'.
#
class trove::db::mysql(
$password,
String[1] $password,
$dbname = 'trove',
$user = 'trove',
$host = '127.0.0.1',
@ -61,8 +61,6 @@ class trove::db::mysql(
include trove::deps
validate_legacy(String, 'validate_string', $password)
::openstacklib::db::mysql { 'trove':
user => $user,
password => $password,

View File

@ -25,7 +25,7 @@
# Default to 'ALL'
#
class trove::db::postgresql(
$password,
String[1] $password,
$dbname = 'trove',
$user = 'trove',
$encoding = undef,
@ -34,8 +34,6 @@ class trove::db::postgresql(
include trove::deps
validate_legacy(String, 'validate_string', $password)
::openstacklib::db::postgresql { 'trove':
password => $password,
dbname => $dbname,

View File

@ -50,9 +50,9 @@
define trove::generic_service(
$package_name,
$service_name,
$enabled = false,
$manage_service = true,
$package_ensure = 'present',
Boolean $enabled = false,
Boolean $manage_service = true,
$package_ensure = 'present',
) {
include trove::deps

View File

@ -91,8 +91,8 @@
# Defaults to undef
#
class trove::guestagent(
$enabled = false,
$manage_service = true,
Boolean $enabled = false,
Boolean $manage_service = true,
$package_ensure = 'present',
$debug = $facts['os_service_default'],
$log_file = '/var/log/trove/trove-guestagent.log',

View File

@ -270,7 +270,7 @@ class trove(
$amqp_sasl_config_name = $facts['os_service_default'],
$amqp_username = $facts['os_service_default'],
$amqp_password = $facts['os_service_default'],
$single_tenant_mode = false,
Boolean $single_tenant_mode = false,
$nova_compute_url = false,
$rpc_response_timeout = $facts['os_service_default'],
$control_exchange = 'trove',

View File

@ -47,8 +47,8 @@
# Defaults to 'trove.taskmanager.manager.Manager'.
#
class trove::taskmanager(
$enabled = true,
$manage_service = true,
Boolean $enabled = true,
Boolean $manage_service = true,
$guest_log_file = '/var/log/trove/trove-guestagent.log',
$package_ensure = 'present',
$guestagent_config_file = '/etc/trove/trove-guestagent.conf',