From 4d1bb7c07c02131f1d34ceb866bb203762b1982a Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 16 Jun 2023 02:30:42 +0900 Subject: [PATCH] replace validate_legacy with proper data types the validate_legacy function is marked for deprecation in v9.0.0 from puppetlabs-stdlib. This change also adds a few more validations about some data types inexplicitly required. Change-Id: I18bc265876f48a7569e971681428fac9e2504486 --- manifests/api.pp | 13 +++---- manifests/backend/dellemc_powerflex.pp | 6 ++-- manifests/backend/dellemc_powermax.pp | 6 ++-- manifests/backend/dellemc_powerstore.pp | 6 ++-- manifests/backend/dellemc_sc.pp | 6 ++-- manifests/backend/dellemc_unity.pp | 14 ++++---- manifests/backend/dellemc_xtremio.pp | 6 ++-- manifests/backend/emc_vnx.pp | 6 ++-- manifests/backend/gpfs.pp | 28 +++++++-------- manifests/backend/hpe3par_iscsi.pp | 6 ++-- manifests/backend/ibm_svf.pp | 6 ++-- manifests/backend/iscsi.pp | 22 ++++++------ manifests/backend/netapp.pp | 46 +++++++++++-------------- manifests/backend/nexenta.pp | 6 ++-- manifests/backend/nfs.pp | 10 +++--- manifests/backend/pure.pp | 6 ++-- manifests/backend/quobyte.pp | 16 ++++----- manifests/backend/rbd.pp | 6 ++-- manifests/backend/san.pp | 34 +++++++++--------- manifests/backend/solidfire.pp | 6 ++-- manifests/backend/vmdk.pp | 6 ++-- manifests/backend/vstorage.pp | 26 +++++++------- manifests/backup.pp | 19 +++++----- manifests/backup/nfs.pp | 4 +-- manifests/config.pp | 10 ++---- manifests/db/mysql.pp | 4 +-- manifests/policy.pp | 4 +-- manifests/scheduler.pp | 11 +++--- manifests/volume.pp | 7 ++-- 29 files changed, 139 insertions(+), 207 deletions(-) diff --git a/manifests/api.pp b/manifests/api.pp index 63fc775c..1920cba8 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -109,20 +109,20 @@ class cinder::api ( $service_workers = $facts['os_workers'], $package_ensure = 'present', $bind_host = $facts['os_service_default'], - $enabled = true, - $manage_service = true, + Boolean $enabled = true, + Boolean $manage_service = true, $ratelimits = $facts['os_service_default'], $default_volume_type = $facts['os_service_default'], $ratelimits_factory = 'cinder.api.v2.limits:RateLimitingMiddleware.factory', - $sync_db = true, + Boolean $sync_db = true, $public_endpoint = $facts['os_service_default'], $osapi_volume_base_url = $facts['os_service_default'], $osapi_max_limit = $facts['os_service_default'], $service_name = $::cinder::params::api_service, $enable_proxy_headers_parsing = $facts['os_service_default'], $max_request_body_size = $facts['os_service_default'], - $use_ssl = false, + Boolean $use_ssl = false, $cert_file = $facts['os_service_default'], $key_file = $facts['os_service_default'], $ca_file = $facts['os_service_default'], @@ -135,11 +135,6 @@ class cinder::api ( include cinder::params include cinder::policy - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $sync_db) - validate_legacy(Boolean, 'validate_bool', $use_ssl) - if $use_ssl { if is_service_default($cert_file) { fail('The cert_file parameter is required when use_ssl is set to true') diff --git a/manifests/backend/dellemc_powerflex.pp b/manifests/backend/dellemc_powerflex.pp index 03ee1a8f..eb42f59d 100644 --- a/manifests/backend/dellemc_powerflex.pp +++ b/manifests/backend/dellemc_powerflex.pp @@ -114,14 +114,12 @@ define cinder::backend::dellemc_powerflex( $san_thin_provision = $facts['os_service_default'], $driver_ssl_cert_verify = $facts['os_service_default'], $driver_ssl_cert_path = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - cinder_config { "${name}/volume_driver": value => 'cinder.volume.drivers.dell_emc.powerflex.driver.PowerFlexDriver'; "${name}/san_login": value => $san_login; diff --git a/manifests/backend/dellemc_powermax.pp b/manifests/backend/dellemc_powermax.pp index b91ad0ab..84ae02ba 100644 --- a/manifests/backend/dellemc_powermax.pp +++ b/manifests/backend/dellemc_powermax.pp @@ -62,14 +62,12 @@ define cinder::backend::dellemc_powermax ( $powermax_storage_protocol = 'iSCSI', $volume_backend_name = $name, $backend_availability_zone = $facts['os_service_default'], - $extra_options = {}, - $manage_volume_type = false, + Hash $extra_options = {}, + Boolean $manage_volume_type = false, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - if $powermax_storage_protocol == 'iSCSI' { $volume_driver = 'cinder.volume.drivers.dell_emc.powermax.iscsi.PowerMaxISCSIDriver' } diff --git a/manifests/backend/dellemc_powerstore.pp b/manifests/backend/dellemc_powerstore.pp index 49b3ef0b..8092a69d 100644 --- a/manifests/backend/dellemc_powerstore.pp +++ b/manifests/backend/dellemc_powerstore.pp @@ -50,14 +50,12 @@ define cinder::backend::dellemc_powerstore ( $storage_protocol = 'iSCSI', $volume_backend_name = $name, $backend_availability_zone = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - if $storage_protocol == 'iSCSI' { $driver = 'dell_emc.powerstore.driver.PowerStoreDriver' } diff --git a/manifests/backend/dellemc_sc.pp b/manifests/backend/dellemc_sc.pp index dca3aeed..c1fda684 100644 --- a/manifests/backend/dellemc_sc.pp +++ b/manifests/backend/dellemc_sc.pp @@ -111,16 +111,14 @@ define cinder::backend::dellemc_sc ( $secondary_san_login = $facts['os_service_default'], $secondary_san_password = $facts['os_service_default'], $secondary_sc_api_port = $facts['os_service_default'], - $manage_volume_type = false, + Boolean $manage_volume_type = false, $use_multipath_for_image_xfer = true, $sc_storage_protocol = 'iSCSI', - $extra_options = {}, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - if $sc_storage_protocol == 'iSCSI' { $volume_driver = 'cinder.volume.drivers.dell_emc.sc.storagecenter_iscsi.SCISCSIDriver' } diff --git a/manifests/backend/dellemc_unity.pp b/manifests/backend/dellemc_unity.pp index 496b6e90..c9757dc1 100644 --- a/manifests/backend/dellemc_unity.pp +++ b/manifests/backend/dellemc_unity.pp @@ -52,18 +52,16 @@ define cinder::backend::dellemc_unity ( $san_login, $san_password, $storage_protocol, - $volume_backend_name = $name, - $backend_availability_zone = $facts['os_service_default'], - $unity_io_ports = $facts['os_service_default'], - $unity_storage_pool_names = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + $volume_backend_name = $name, + $backend_availability_zone = $facts['os_service_default'], + $unity_io_ports = $facts['os_service_default'], + $unity_storage_pool_names = $facts['os_service_default'], + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - $driver = 'dell_emc.unity.Driver' cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; diff --git a/manifests/backend/dellemc_xtremio.pp b/manifests/backend/dellemc_xtremio.pp index 6ded8e72..d14f8a20 100644 --- a/manifests/backend/dellemc_xtremio.pp +++ b/manifests/backend/dellemc_xtremio.pp @@ -72,16 +72,14 @@ define cinder::backend::dellemc_xtremio ( $xtremio_array_busy_retry_count = $facts['os_service_default'], $xtremio_array_busy_retry_interval = $facts['os_service_default'], $xtremio_volumes_per_glance_cache = $facts['os_service_default'], - $manage_volume_type = false, + Boolean $manage_volume_type = false, $xtremio_storage_protocol = 'iSCSI', $xtremio_ports = $facts['os_service_default'], - $extra_options = {}, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - if $xtremio_storage_protocol == 'iSCSI' { $driver = 'dell_emc.xtremio.XtremIOISCSIDriver' } diff --git a/manifests/backend/emc_vnx.pp b/manifests/backend/emc_vnx.pp index a4da8847..d11c4a60 100644 --- a/manifests/backend/emc_vnx.pp +++ b/manifests/backend/emc_vnx.pp @@ -121,7 +121,7 @@ define cinder::backend::emc_vnx ( $san_login = 'admin', $volume_backend_name = $name, $backend_availability_zone = $facts['os_service_default'], - $extra_options = {}, + Hash $extra_options = {}, $volume_driver = 'cinder.volume.drivers.dell_emc.vnx.driver.VNXDriver', $storage_protocol = 'iscsi', $destroy_empty_storage_group = $facts['os_service_default'], @@ -135,14 +135,12 @@ define cinder::backend::emc_vnx ( $storage_vnx_auth_type = $facts['os_service_default'], $storage_vnx_security_file_dir = $facts['os_service_default'], $naviseccli_path = $facts['os_service_default'], - $manage_volume_type = false, + Boolean $manage_volume_type = false, ) { include cinder::deps include cinder::params - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - cinder_config { "${name}/default_timeout": value => $default_timeout; "${name}/max_luns_per_storage_group": value => $max_luns_per_storage_group; diff --git a/manifests/backend/gpfs.pp b/manifests/backend/gpfs.pp index 1384c10f..8300949c 100644 --- a/manifests/backend/gpfs.pp +++ b/manifests/backend/gpfs.pp @@ -92,25 +92,23 @@ # define cinder::backend::gpfs ( $gpfs_mount_point_base, - $gpfs_images_dir = $facts['os_service_default'], - $gpfs_images_share_mode = $facts['os_service_default'], - $gpfs_max_clone_depth = $facts['os_service_default'], - $gpfs_sparse_volumes = $facts['os_service_default'], - $gpfs_storage_pool = $facts['os_service_default'], - $nas_host = $facts['os_service_default'], - $nas_login = $facts['os_service_default'], - $nas_password = $facts['os_service_default'], - $nas_private_key = $facts['os_service_default'], - $nas_ssh_port = $facts['os_service_default'], - $backend_availability_zone = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + $gpfs_images_dir = $facts['os_service_default'], + $gpfs_images_share_mode = $facts['os_service_default'], + $gpfs_max_clone_depth = $facts['os_service_default'], + $gpfs_sparse_volumes = $facts['os_service_default'], + $gpfs_storage_pool = $facts['os_service_default'], + $nas_host = $facts['os_service_default'], + $nas_login = $facts['os_service_default'], + $nas_password = $facts['os_service_default'], + $nas_private_key = $facts['os_service_default'], + $nas_ssh_port = $facts['os_service_default'], + $backend_availability_zone = $facts['os_service_default'], + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - if ! ($gpfs_images_share_mode in ['copy', 'copy_on_write', $facts['os_service_default']]) { fail('gpfs_images_share_mode only support `copy` or `copy_on_write`') } diff --git a/manifests/backend/hpe3par_iscsi.pp b/manifests/backend/hpe3par_iscsi.pp index 00d02ea1..2b20f2dd 100644 --- a/manifests/backend/hpe3par_iscsi.pp +++ b/manifests/backend/hpe3par_iscsi.pp @@ -86,14 +86,12 @@ define cinder::backend::hpe3par_iscsi( $hpe3par_cpg_snap = 'userCPG', $hpe3par_snapshot_retention = 48, $hpe3par_snapshot_expiration = 72, - $manage_volume_type = false, - $extra_options = {}, + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - if ($hpe3par_snapshot_expiration <= $hpe3par_snapshot_retention) { fail ('hpe3par_snapshot_expiration must be greater than hpe3par_snapshot_retention') } diff --git a/manifests/backend/ibm_svf.pp b/manifests/backend/ibm_svf.pp index f8035599..f1bf810f 100644 --- a/manifests/backend/ibm_svf.pp +++ b/manifests/backend/ibm_svf.pp @@ -77,14 +77,12 @@ define cinder::backend::ibm_svf ( $storwize_portset = $facts['os_service_default'], $volume_backend_name = $name, $backend_availability_zone = $facts['os_service_default'], - $extra_options = {}, - $manage_volume_type = false, + Hash $extra_options = {}, + Boolean $manage_volume_type = false, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - # NOTE: Svf was earlier called as storwize/svc driver, so the cinder # configuration parameters were named accordingly. if $storwize_svc_connection_protocol == 'iSCSI' { diff --git a/manifests/backend/iscsi.pp b/manifests/backend/iscsi.pp index 8d48278e..b3e4139d 100644 --- a/manifests/backend/iscsi.pp +++ b/manifests/backend/iscsi.pp @@ -50,23 +50,21 @@ # { 'iscsi_backend/param1' => { 'value' => value1 } } # define cinder::backend::iscsi ( - $target_ip_address = undef, - $volume_backend_name = $name, - $backend_availability_zone = $facts['os_service_default'], - $volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver', - $volume_group = $facts['os_service_default'], - $volumes_dir = '/var/lib/cinder/volumes', - $target_helper = $::cinder::params::target_helper, - $target_protocol = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + $target_ip_address = undef, + $volume_backend_name = $name, + $backend_availability_zone = $facts['os_service_default'], + $volume_driver = 'cinder.volume.drivers.lvm.LVMVolumeDriver', + $volume_group = $facts['os_service_default'], + $volumes_dir = '/var/lib/cinder/volumes', + $target_helper = $::cinder::params::target_helper, + $target_protocol = $facts['os_service_default'], + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps include cinder::params - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - # NOTE(mnaser): Cinder requires /usr/sbin/thin_check to create volumes which # does not get installed with Cinder (see LP#1615134). if $facts['os']['family'] == 'Debian' { diff --git a/manifests/backend/netapp.pp b/manifests/backend/netapp.pp index 5956b766..75e97614 100644 --- a/manifests/backend/netapp.pp +++ b/manifests/backend/netapp.pp @@ -170,42 +170,38 @@ define cinder::backend::netapp ( $netapp_login, $netapp_password, $netapp_server_hostname, - $volume_backend_name = $name, - $backend_availability_zone = $facts['os_service_default'], - $netapp_server_port = $facts['os_service_default'], - $netapp_size_multiplier = $facts['os_service_default'], - $netapp_storage_family = $facts['os_service_default'], - $netapp_storage_protocol = 'nfs', - $netapp_transport_type = $facts['os_service_default'], - $netapp_vserver = $facts['os_service_default'], - $expiry_thres_minutes = $facts['os_service_default'], - $thres_avl_size_perc_start = $facts['os_service_default'], - $thres_avl_size_perc_stop = $facts['os_service_default'], - $nfs_shares = undef, - $nfs_shares_config = '/etc/cinder/shares.conf', - $nfs_mount_options = $facts['os_service_default'], - $netapp_host_type = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, - $netapp_pool_name_search_pattern = $facts['os_service_default'], - $nas_secure_file_operations = $facts['os_service_default'], - $nas_secure_file_permissions = $facts['os_service_default'], + $volume_backend_name = $name, + $backend_availability_zone = $facts['os_service_default'], + $netapp_server_port = $facts['os_service_default'], + $netapp_size_multiplier = $facts['os_service_default'], + $netapp_storage_family = $facts['os_service_default'], + $netapp_storage_protocol = 'nfs', + $netapp_transport_type = $facts['os_service_default'], + $netapp_vserver = $facts['os_service_default'], + $expiry_thres_minutes = $facts['os_service_default'], + $thres_avl_size_perc_start = $facts['os_service_default'], + $thres_avl_size_perc_stop = $facts['os_service_default'], + Optional[Array[String]] $nfs_shares = undef, + $nfs_shares_config = '/etc/cinder/shares.conf', + $nfs_mount_options = $facts['os_service_default'], + $netapp_host_type = $facts['os_service_default'], + Boolean $manage_volume_type = false, + Hash $extra_options = {}, + $netapp_pool_name_search_pattern = $facts['os_service_default'], + $nas_secure_file_operations = $facts['os_service_default'], + $nas_secure_file_permissions = $facts['os_service_default'], # DEPRECATED PARAMETERS - $netapp_copyoffload_tool_path = undef, + $netapp_copyoffload_tool_path = undef, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - if $netapp_copyoffload_tool_path != undef { warning("The netapp_copyoffload_tool_path parameter has been deprecated \ and will be removed in a future release.") } if $nfs_shares { - validate_legacy(Array, 'validate_array', $nfs_shares) - file {$nfs_shares_config: content => join($nfs_shares, "\n"), require => Anchor['cinder::install::end'], diff --git a/manifests/backend/nexenta.pp b/manifests/backend/nexenta.pp index 0e133c2d..8370fe0c 100644 --- a/manifests/backend/nexenta.pp +++ b/manifests/backend/nexenta.pp @@ -76,14 +76,12 @@ define cinder::backend::nexenta ( $nexenta_sparse = true, $nexenta_rest_port = '8457', $volume_driver = 'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver', - $manage_volume_type = false, - $extra_options = {}, + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; "${name}/backend_availability_zone": value => $backend_availability_zone; diff --git a/manifests/backend/nfs.pp b/manifests/backend/nfs.pp index 7005d019..ae58ff34 100644 --- a/manifests/backend/nfs.pp +++ b/manifests/backend/nfs.pp @@ -92,7 +92,7 @@ define cinder::backend::nfs ( $volume_backend_name = $name, $backend_availability_zone = $facts['os_service_default'], - $nfs_servers = [], + Array[String] $nfs_servers = [], $nfs_mount_attempts = $facts['os_service_default'], $nfs_mount_options = $facts['os_service_default'], $nfs_sparsed_volumes = $facts['os_service_default'], @@ -104,15 +104,13 @@ define cinder::backend::nfs ( $nas_secure_file_permissions = $facts['os_service_default'], $nfs_snapshot_support = $facts['os_service_default'], $nfs_qcow2_volumes = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - - file {$nfs_shares_config: + file { $nfs_shares_config: content => join($nfs_servers, "\n"), require => Anchor['cinder::install::end'], notify => Anchor['cinder::service::begin'], diff --git a/manifests/backend/pure.pp b/manifests/backend/pure.pp index 14866047..9b892105 100644 --- a/manifests/backend/pure.pp +++ b/manifests/backend/pure.pp @@ -100,7 +100,7 @@ define cinder::backend::pure( $pure_storage_protocol = 'iSCSI', $use_chap_auth = false, $use_multipath_for_image_xfer = true, - $manage_volume_type = false, + Boolean $manage_volume_type = false, $image_volume_cache_enabled = true, $pure_host_personality = $facts['os_service_default'], $pure_eradicate_on_delete = $facts['os_service_default'], @@ -109,13 +109,11 @@ define cinder::backend::pure( $pure_nvme_cidr_list = $facts['os_service_default'], $pure_iscsi_cidr = $facts['os_service_default'], $pure_iscsi_cidr_list = $facts['os_service_default'], - $extra_options = {}, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - $volume_driver = $pure_storage_protocol ? { 'FC' => 'cinder.volume.drivers.pure.PureFCDriver', 'iSCSI' => 'cinder.volume.drivers.pure.PureISCSIDriver', diff --git a/manifests/backend/quobyte.pp b/manifests/backend/quobyte.pp index 045953ab..0a484588 100644 --- a/manifests/backend/quobyte.pp +++ b/manifests/backend/quobyte.pp @@ -54,19 +54,17 @@ # define cinder::backend::quobyte ( $quobyte_volume_url, - $quobyte_client_cfg = undef, - $quobyte_qcow2_volumes = undef, - $quobyte_sparsed_volumes = undef, - $quobyte_mount_point_base = undef, - $volume_backend_name = $name, - $backend_availability_zone = $facts['os_service_default'], - $manage_volume_type = false, + $quobyte_client_cfg = undef, + $quobyte_qcow2_volumes = undef, + $quobyte_sparsed_volumes = undef, + $quobyte_mount_point_base = undef, + $volume_backend_name = $name, + $backend_availability_zone = $facts['os_service_default'], + Boolean $manage_volume_type = false, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; "${name}/backend_availability_zone": value => $backend_availability_zone; diff --git a/manifests/backend/rbd.pp b/manifests/backend/rbd.pp index 38e0cce7..e20d22cc 100644 --- a/manifests/backend/rbd.pp +++ b/manifests/backend/rbd.pp @@ -100,15 +100,13 @@ define cinder::backend::rbd ( $rbd_store_chunk_size = $facts['os_service_default'], $report_dynamic_total_capacity = $facts['os_service_default'], $rbd_exclusive_cinder_pool = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps include cinder::params - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - $rbd_cluster_name = basename($rbd_ceph_conf, '.conf') if $rbd_cluster_name == 'ceph' { # Do not pass a parameter value in order to avoid service restarts diff --git a/manifests/backend/san.pp b/manifests/backend/san.pp index fdfbc841..1ed4fb03 100644 --- a/manifests/backend/san.pp +++ b/manifests/backend/san.pp @@ -81,28 +81,26 @@ # define cinder::backend::san ( $volume_driver, - $volume_backend_name = $name, - $backend_availability_zone = $facts['os_service_default'], - $san_thin_provision = $facts['os_service_default'], - $san_ip = $facts['os_service_default'], - $san_login = $facts['os_service_default'], - $san_password = $facts['os_service_default'], - $san_private_key = $facts['os_service_default'], - $san_clustername = $facts['os_service_default'], - $san_ssh_port = $facts['os_service_default'], - $san_api_port = $facts['os_service_default'], - $san_is_local = $facts['os_service_default'], - $ssh_conn_timeout = $facts['os_service_default'], - $ssh_min_pool_conn = $facts['os_service_default'], - $ssh_max_pool_conn = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + $volume_backend_name = $name, + $backend_availability_zone = $facts['os_service_default'], + $san_thin_provision = $facts['os_service_default'], + $san_ip = $facts['os_service_default'], + $san_login = $facts['os_service_default'], + $san_password = $facts['os_service_default'], + $san_private_key = $facts['os_service_default'], + $san_clustername = $facts['os_service_default'], + $san_ssh_port = $facts['os_service_default'], + $san_api_port = $facts['os_service_default'], + $san_is_local = $facts['os_service_default'], + $ssh_conn_timeout = $facts['os_service_default'], + $ssh_min_pool_conn = $facts['os_service_default'], + $ssh_max_pool_conn = $facts['os_service_default'], + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; "${name}/backend_availability_zone": value => $backend_availability_zone; diff --git a/manifests/backend/solidfire.pp b/manifests/backend/solidfire.pp index 7a9495f7..ab86b6a6 100644 --- a/manifests/backend/solidfire.pp +++ b/manifests/backend/solidfire.pp @@ -119,14 +119,12 @@ define cinder::backend::solidfire( $sf_api_request_timeout = $facts['os_service_default'], $sf_volume_clone_timeout = $facts['os_service_default'], $sf_volume_create_timeout = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; "${name}/backend_availability_zone": value => $backend_availability_zone; diff --git a/manifests/backend/vmdk.pp b/manifests/backend/vmdk.pp index 70e028f9..248830d9 100644 --- a/manifests/backend/vmdk.pp +++ b/manifests/backend/vmdk.pp @@ -81,14 +81,12 @@ define cinder::backend::vmdk ( $task_poll_interval = $facts['os_service_default'], $image_transfer_timeout_secs = $facts['os_service_default'], $wsdl_location = $facts['os_service_default'], - $manage_volume_type = false, - $extra_options = {}, + Boolean $manage_volume_type = false, + Hash $extra_options = {}, ) { include cinder::deps - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - cinder_config { "${name}/volume_backend_name": value => $volume_backend_name; "${name}/backend_availability_zone": value => $backend_availability_zone; diff --git a/manifests/backend/vstorage.pp b/manifests/backend/vstorage.pp index f8c47cc5..8552a997 100644 --- a/manifests/backend/vstorage.pp +++ b/manifests/backend/vstorage.pp @@ -65,25 +65,23 @@ define cinder::backend::vstorage ( $cluster_name, $cluster_password, - $volume_backend_name = $name, - $backend_availability_zone = $facts['os_service_default'], - $shares_config_path = '/etc/cinder/vzstorage_shares', - $use_sparsed_volumes = $facts['os_service_default'], - $used_ratio = $facts['os_service_default'], - $mount_point_base = $facts['os_service_default'], - $default_volume_format = $facts['os_service_default'], - $manage_volume_type = false, - $mount_user = undef, - $mount_group = 'root', - $mount_permissions = '0770', - $manage_package = true, + $volume_backend_name = $name, + $backend_availability_zone = $facts['os_service_default'], + $shares_config_path = '/etc/cinder/vzstorage_shares', + $use_sparsed_volumes = $facts['os_service_default'], + $used_ratio = $facts['os_service_default'], + $mount_point_base = $facts['os_service_default'], + $default_volume_format = $facts['os_service_default'], + Boolean $manage_volume_type = false, + $mount_user = undef, + $mount_group = 'root', + $mount_permissions = '0770', + Boolean $manage_package = true, ) { include cinder::deps include cinder::params - validate_legacy(Boolean, 'validate_bool', $manage_volume_type) - $mount_user_real = pick($mount_user, $::cinder::params::user) cinder_config { diff --git a/manifests/backup.pp b/manifests/backup.pp index b789d2dd..46ae2231 100644 --- a/manifests/backup.pp +++ b/manifests/backup.pp @@ -58,22 +58,19 @@ # under the License. # class cinder::backup ( - $enabled = true, - $manage_service = true, - $package_ensure = 'present', - $backup_manager = $facts['os_service_default'], - $backup_api_class = $facts['os_service_default'], - $backup_name_template = $facts['os_service_default'], - $backup_workers = $facts['os_service_default'], - $backup_max_operations = $facts['os_service_default'], + Boolean $enabled = true, + Boolean $manage_service = true, + $package_ensure = 'present', + $backup_manager = $facts['os_service_default'], + $backup_api_class = $facts['os_service_default'], + $backup_name_template = $facts['os_service_default'], + $backup_workers = $facts['os_service_default'], + $backup_max_operations = $facts['os_service_default'], ) { include cinder::deps include cinder::params - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - if $::cinder::params::backup_package { package { 'cinder-backup': ensure => $package_ensure, diff --git a/manifests/backup/nfs.pp b/manifests/backup/nfs.pp index 1d0bb3a7..90b32f91 100644 --- a/manifests/backup/nfs.pp +++ b/manifests/backup/nfs.pp @@ -69,7 +69,7 @@ # # class cinder::backup::nfs ( - $backup_share, + String[1] $backup_share, $backup_driver = 'cinder.backup.drivers.nfs.NFSBackupDriver', $backup_file_size = $facts['os_service_default'], $backup_sha_block_size_bytes = $facts['os_service_default'], @@ -82,8 +82,6 @@ class cinder::backup::nfs ( include cinder::deps - validate_legacy(String, 'validate_string', $backup_share) - cinder_config { 'DEFAULT/backup_mount_options': value => $backup_mount_options; 'DEFAULT/backup_share': value => $backup_share; diff --git a/manifests/config.pp b/manifests/config.pp index 9129b2d1..d395ac89 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -32,17 +32,13 @@ # or Puppet catalog compilation will fail with duplicate resources. # class cinder::config ( - $cinder_config = {}, - $api_paste_ini_config = {}, - $cinder_rootwrap_config = {}, + Hash $cinder_config = {}, + Hash $api_paste_ini_config = {}, + Hash $cinder_rootwrap_config = {}, ) { include cinder::deps - validate_legacy(Hash, 'validate_hash', $cinder_config) - validate_legacy(Hash, 'validate_hash', $api_paste_ini_config) - validate_legacy(Hash, 'validate_hash', $cinder_rootwrap_config) - create_resources('cinder_config', $cinder_config) create_resources('cinder_api_paste_ini', $api_paste_ini_config) create_resources('cinder_rootwrap_config', $cinder_rootwrap_config) diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 9c234f96..874e5b5a 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -33,7 +33,7 @@ # Defaults to 'utf8_general_ci' # class cinder::db::mysql ( - $password, + String[1] $password, $dbname = 'cinder', $user = 'cinder', $host = '127.0.0.1', @@ -44,8 +44,6 @@ class cinder::db::mysql ( include cinder::deps - validate_legacy(String, 'validate_string', $password) - ::openstacklib::db::mysql { 'cinder': user => $user, password => $password, diff --git a/manifests/policy.pp b/manifests/policy.pp index 0163cf53..e5965c43 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -48,7 +48,7 @@ class cinder::policy ( $enforce_scope = $facts['os_service_default'], $enforce_new_defaults = $facts['os_service_default'], - $policies = {}, + Hash $policies = {}, $policy_path = '/etc/cinder/policy.yaml', $policy_default_rule = $facts['os_service_default'], $policy_dirs = $facts['os_service_default'], @@ -58,8 +58,6 @@ class cinder::policy ( include cinder::deps include cinder::params - validate_legacy(Hash, 'validate_hash', $policies) - $policy_parameters = { policies => $policies, policy_path => $policy_path, diff --git a/manifests/scheduler.pp b/manifests/scheduler.pp index f84047f3..daf86e41 100644 --- a/manifests/scheduler.pp +++ b/manifests/scheduler.pp @@ -22,18 +22,15 @@ # # class cinder::scheduler ( - $scheduler_driver = $facts['os_service_default'], - $package_ensure = 'present', - $enabled = true, - $manage_service = true + $scheduler_driver = $facts['os_service_default'], + $package_ensure = 'present', + Boolean $enabled = true, + Boolean $manage_service = true ) { include cinder::deps include cinder::params - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - cinder_config { 'DEFAULT/scheduler_driver': value => $scheduler_driver; } if $::cinder::params::scheduler_package { diff --git a/manifests/volume.pp b/manifests/volume.pp index 45b4c6ea..78e59f56 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -59,8 +59,8 @@ # class cinder::volume ( $package_ensure = 'present', - $enabled = true, - $manage_service = true, + Boolean $enabled = true, + Boolean $manage_service = true, $cluster = $facts['os_service_default'], $volume_clear = $facts['os_service_default'], $volume_clear_size = $facts['os_service_default'], @@ -75,9 +75,6 @@ class cinder::volume ( include cinder::deps include cinder::params - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - if $::cinder::params::volume_package { package { 'cinder-volume': ensure => $package_ensure,