diff --git a/manifests/api.pp b/manifests/api.pp index 013b20063..7476536b2 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -161,8 +161,8 @@ # Defaults to undef # class nova::api( - $enabled = true, - $manage_service = true, + Boolean $enabled = true, + Boolean $manage_service = true, $api_paste_config = 'api-paste.ini', $ensure_package = 'present', $api_bind_address = $facts['os_service_default'], @@ -172,9 +172,9 @@ class nova::api( $enabled_apis = ['osapi_compute', 'metadata'], $osapi_compute_workers = $facts['os_workers'], $metadata_workers = $facts['os_workers'], - $sync_db = true, - $sync_db_api = true, - $db_online_data_migrations = false, + Boolean $sync_db = true, + Boolean $sync_db_api = true, + Boolean $db_online_data_migrations = false, $service_name = $::nova::params::api_service_name, $metadata_service_name = $::nova::params::api_metadata_service_name, $enable_proxy_headers_parsing = $facts['os_service_default'], @@ -193,7 +193,7 @@ class nova::api( $instance_list_cells_batch_fixed_size = $facts['os_service_default'], $list_records_by_skipping_down_cells = $facts['os_service_default'], # DEPRECATED PARAMETER - $nova_metadata_wsgi_enabled = false, + Boolean $nova_metadata_wsgi_enabled = false, $use_forwarded_for = undef, ) inherits nova::params { @@ -204,12 +204,6 @@ class nova::api( include nova::availability_zone include nova::pci - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $sync_db) - validate_legacy(Boolean, 'validate_bool', $sync_db_api) - validate_legacy(Boolean, 'validate_bool', $db_online_data_migrations) - if !$nova_metadata_wsgi_enabled { warning('Running nova metadata api via evenlet is deprecated and will be removed in Stein release.') } diff --git a/manifests/compute.pp b/manifests/compute.pp index bb0f6d868..bbc8488df 100644 --- a/manifests/compute.pp +++ b/manifests/compute.pp @@ -254,18 +254,18 @@ # Defaults to $facts['os_service_default'] # class nova::compute ( - $enabled = true, - $manage_service = true, + Boolean $enabled = true, + Boolean $manage_service = true, $ensure_package = 'present', - $vnc_enabled = true, - $spice_enabled = false, + Boolean $vnc_enabled = true, + Boolean $spice_enabled = false, $vncserver_proxyclient_address = '127.0.0.1', $vncproxy_host = false, $vncproxy_protocol = 'http', $vncproxy_port = '6080', $vncproxy_path = '/vnc_auto.html', - $force_config_drive = false, - $instance_usage_audit = false, + Boolean $force_config_drive = false, + Boolean $instance_usage_audit = false, $instance_usage_audit_period = $facts['os_service_default'], $mkisofs_cmd = $facts['os_service_default'], $use_cow_images = $facts['os_service_default'], @@ -290,7 +290,7 @@ class nova::compute ( $sync_power_state_interval = $facts['os_service_default'], $consecutive_build_service_disable_threshold = $facts['os_service_default'], $reserved_huge_pages = $facts['os_service_default'], - $neutron_physnets_numa_nodes_mapping = {}, + Hash $neutron_physnets_numa_nodes_mapping = {}, $neutron_tunnel_numa_nodes = [], $live_migration_wait_for_vif_plug = $facts['os_service_default'], $max_disk_devices_to_attach = $facts['os_service_default'], @@ -308,13 +308,6 @@ class nova::compute ( include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $vnc_enabled) - validate_legacy(Boolean, 'validate_bool', $force_config_drive) - validate_legacy(Boolean, 'validate_bool', $instance_usage_audit) - - $image_type_exclude_list_real = pick(join(any2array($image_type_exclude_list), ','), $facts['os_service_default']) include nova::policy @@ -333,7 +326,6 @@ class nova::compute ( } if !empty($neutron_physnets_numa_nodes_mapping) { - validate_legacy(Hash, 'validate_hash', $neutron_physnets_numa_nodes_mapping) $neutron_physnets_real = keys($neutron_physnets_numa_nodes_mapping) nova_config { 'neutron/physnets': value => join(any2array($neutron_physnets_real), ','); diff --git a/manifests/compute/libvirt.pp b/manifests/compute/libvirt.pp index 95b79f52c..b1c8d5431 100644 --- a/manifests/compute/libvirt.pp +++ b/manifests/compute/libvirt.pp @@ -233,9 +233,9 @@ class nova::compute::libvirt ( $ensure_package = 'present', $virt_type = 'kvm', $vncserver_listen = '127.0.0.1', - $migration_support = false, + Boolean $migration_support = false, $cpu_mode = false, - $cpu_models = [], + Array[String[1]] $cpu_models = [], $cpu_model_extra_flags = undef, $cpu_power_management = $facts['os_service_default'], $cpu_power_management_strategy = $facts['os_service_default'], @@ -258,7 +258,7 @@ class nova::compute::libvirt ( $virtlog_service_name = $::nova::params::virtlog_service_name, $compute_driver = 'libvirt.LibvirtDriver', $preallocate_images = $facts['os_service_default'], - $manage_libvirt_services = true, + Boolean $manage_libvirt_services = true, $rx_queue_size = $facts['os_service_default'], $tx_queue_size = $facts['os_service_default'], $file_backed_memory = $facts['os_service_default'], @@ -279,9 +279,6 @@ class nova::compute::libvirt ( include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $migration_support) - validate_legacy(Boolean, 'validate_bool', $manage_libvirt_services) - # cpu_mode has different defaults depending on hypervisor. if !$cpu_mode { case $virt_type { @@ -381,7 +378,6 @@ class nova::compute::libvirt ( 'libvirt/wait_soft_reboot_seconds': value => $wait_soft_reboot_seconds; } - validate_legacy(Array, 'validate_array', $cpu_models) # cpu_model param is only valid if cpu_mode=custom # otherwise it should be commented out if $cpu_mode_default == 'custom' and !empty($cpu_models){ diff --git a/manifests/compute/libvirt/config.pp b/manifests/compute/libvirt/config.pp index 6d92c0904..fad410d80 100644 --- a/manifests/compute/libvirt/config.pp +++ b/manifests/compute/libvirt/config.pp @@ -53,29 +53,19 @@ # or Puppet catalog compilation will fail with duplicate resources. # class nova::compute::libvirt::config ( - $libvirtd_config = {}, - $virtlogd_config = {}, - $virtlockd_config = {}, - $virtnodedevd_config = {}, - $virtproxyd_config = {}, - $virtqemud_config = {}, - $virtsecretd_config = {}, - $virtstoraged_config = {}, - $qemu_config = {}, + Hash $libvirtd_config = {}, + Hash $virtlogd_config = {}, + Hash $virtlockd_config = {}, + Hash $virtnodedevd_config = {}, + Hash $virtproxyd_config = {}, + Hash $virtqemud_config = {}, + Hash $virtsecretd_config = {}, + Hash $virtstoraged_config = {}, + Hash $qemu_config = {}, ) { include nova::deps - validate_legacy(Hash, 'validate_hash', $libvirtd_config) - validate_legacy(Hash, 'validate_hash', $virtlogd_config) - validate_legacy(Hash, 'validate_hash', $virtlockd_config) - validate_legacy(Hash, 'validate_hash', $virtnodedevd_config) - validate_legacy(Hash, 'validate_hash', $virtproxyd_config) - validate_legacy(Hash, 'validate_hash', $virtqemud_config) - validate_legacy(Hash, 'validate_hash', $virtsecretd_config) - validate_legacy(Hash, 'validate_hash', $virtstoraged_config) - validate_legacy(Hash, 'validate_hash', $qemu_config) - create_resources('libvirtd_config', $libvirtd_config) create_resources('virtlogd_config', $virtlogd_config) create_resources('virtlockd_config', $virtlockd_config) diff --git a/manifests/compute/libvirt/networks.pp b/manifests/compute/libvirt/networks.pp index e68c773a5..6f90ad354 100644 --- a/manifests/compute/libvirt/networks.pp +++ b/manifests/compute/libvirt/networks.pp @@ -9,13 +9,11 @@ # Defaults to true. # class nova::compute::libvirt::networks( - $disable_default_network = true, + Boolean $disable_default_network = true, ) { include nova::deps - validate_legacy(Boolean, 'validate_bool', $disable_default_network) - if $disable_default_network { exec { 'libvirt-default-net-disable-autostart': command => 'virsh net-autostart default --disable', diff --git a/manifests/compute/libvirt/qemu.pp b/manifests/compute/libvirt/qemu.pp index 635f7bb16..12d9384f8 100644 --- a/manifests/compute/libvirt/qemu.pp +++ b/manifests/compute/libvirt/qemu.pp @@ -51,27 +51,21 @@ # Defaults to ::nova::compute::libvirt::version::default # class nova::compute::libvirt::qemu( - $configure_qemu = false, - $user = undef, - $group = undef, - $max_files = 1024, - $max_processes = 4096, - $vnc_tls = false, - $vnc_tls_verify = true, - $default_tls_verify = true, - $memory_backing_dir = undef, - $nbd_tls = false, - $libvirt_version = $::nova::compute::libvirt::version::default, + Boolean $configure_qemu = false, + $user = undef, + $group = undef, + $max_files = 1024, + $max_processes = 4096, + Boolean $vnc_tls = false, + Boolean $vnc_tls_verify = true, + Boolean $default_tls_verify = true, + $memory_backing_dir = undef, + Boolean $nbd_tls = false, + $libvirt_version = $::nova::compute::libvirt::version::default, ) inherits nova::compute::libvirt::version { include nova::deps - validate_legacy(Boolean, 'validate_bool', $configure_qemu) - validate_legacy(Boolean, 'validate_bool', $vnc_tls) - validate_legacy(Boolean, 'validate_bool', $vnc_tls_verify) - validate_legacy(Boolean, 'validate_bool', $default_tls_verify) - validate_legacy(Boolean, 'validate_bool', $nbd_tls) - if versioncmp($libvirt_version, '4.5') < 0 { fail('libvirt version < 4.5 is no longer supported') } diff --git a/manifests/compute/libvirt_guests.pp b/manifests/compute/libvirt_guests.pp index 7f08a0232..7b558441f 100644 --- a/manifests/compute/libvirt_guests.pp +++ b/manifests/compute/libvirt_guests.pp @@ -47,19 +47,16 @@ # Defaults to false # class nova::compute::libvirt_guests ( - $enabled = false, - $package_ensure = 'present', - $shutdown_timeout = '300', - $on_boot = 'ignore', - $on_shutdown = 'shutdown', - $manage_service = false, + Boolean $enabled = false, + $package_ensure = 'present', + $shutdown_timeout = '300', + $on_boot = 'ignore', + $on_shutdown = 'shutdown', + Boolean $manage_service = false, ) { include nova::params include nova::deps - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - Anchor['nova::config::begin'] -> File<| tag =='libvirt-guests-file' |> -> File_line<| tag == 'libvirt-guests-file_line'|> diff --git a/manifests/compute/mdev.pp b/manifests/compute/mdev.pp index aeb866f17..2012efb2b 100644 --- a/manifests/compute/mdev.pp +++ b/manifests/compute/mdev.pp @@ -9,12 +9,10 @@ # Defaults to {} # class nova::compute::mdev( - $mdev_types = {}, + Hash $mdev_types = {}, ) { include nova::deps - validate_legacy(Hash, 'validate_hash', $mdev_types) - if !empty($mdev_types) { nova_config { 'devices/enabled_mdev_types': value => join(keys($mdev_types), ',') diff --git a/manifests/compute/rbd.pp b/manifests/compute/rbd.pp index c00801d51..db173bc4c 100644 --- a/manifests/compute/rbd.pp +++ b/manifests/compute/rbd.pp @@ -94,8 +94,8 @@ class nova::compute::rbd ( $libvirt_images_rbd_glance_copy_poll_interval = $facts['os_service_default'], $libvirt_images_rbd_glance_copy_timeout = $facts['os_service_default'], $rbd_keyring = 'client.nova', - $ephemeral_storage = true, - $manage_ceph_client = true, + Boolean $ephemeral_storage = true, + Boolean $manage_ceph_client = true, $ceph_client_ensure = 'present', $package_ensure = 'present', ) { @@ -103,9 +103,6 @@ class nova::compute::rbd ( include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $ephemeral_storage) - validate_legacy(Boolean, 'validate_bool', $manage_ceph_client) - if $manage_ceph_client { # Install ceph client libraries package { 'ceph-client-package': diff --git a/manifests/compute/spice.pp b/manifests/compute/spice.pp index 8978b264b..fe15749e1 100644 --- a/manifests/compute/spice.pp +++ b/manifests/compute/spice.pp @@ -34,7 +34,7 @@ # Defaults to '/spice_auto.html' # class nova::compute::spice( - $agent_enabled = true, + Boolean $agent_enabled = true, $server_listen = $facts['os_service_default'], $server_proxyclient_address = '127.0.0.1', $proxy_host = false, @@ -45,8 +45,6 @@ class nova::compute::spice( include nova::deps - validate_legacy(Boolean, 'validate_bool', $agent_enabled) - if $proxy_host { $html5proxy_base_url = "${proxy_protocol}://${proxy_host}:${proxy_port}${proxy_path}" nova_config { diff --git a/manifests/conductor.pp b/manifests/conductor.pp index eb0e5cb09..d99944311 100644 --- a/manifests/conductor.pp +++ b/manifests/conductor.pp @@ -28,11 +28,11 @@ # Defaults to $facts['os_service_default'] # class nova::conductor( - $enabled = true, - $manage_service = true, - $ensure_package = 'present', - $workers = $facts['os_workers'], - $enable_new_services = $facts['os_service_default'], + Boolean $enabled = true, + Boolean $manage_service = true, + $ensure_package = 'present', + $workers = $facts['os_workers'], + $enable_new_services = $facts['os_service_default'], ) { include nova::deps @@ -40,9 +40,6 @@ class nova::conductor( include nova::params include nova::availability_zone - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $manage_service) - nova::generic_service { 'conductor': enabled => $enabled, manage_service => $manage_service, diff --git a/manifests/config.pp b/manifests/config.pp index 5ac9b2493..16100d59a 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -34,17 +34,13 @@ # or Puppet catalog compilation will fail with duplicate resources. # class nova::config ( - $nova_config = {}, - $nova_api_paste_ini = {}, - $nova_rootwrap_config = {}, + Hash $nova_config = {}, + Hash $nova_api_paste_ini = {}, + Hash $nova_rootwrap_config = {}, ) { include nova::deps - validate_legacy(Hash, 'validate_hash', $nova_config) - validate_legacy(Hash, 'validate_hash', $nova_api_paste_ini) - validate_legacy(Hash, 'validate_hash', $nova_rootwrap_config) - create_resources('nova_config', $nova_config) create_resources('nova_api_paste_ini', $nova_api_paste_ini) create_resources('nova_rootwrap_config', $nova_rootwrap_config) diff --git a/manifests/cron/archive_deleted_rows.pp b/manifests/cron/archive_deleted_rows.pp index 046e55d8c..ecb6ddc6d 100644 --- a/manifests/cron/archive_deleted_rows.pp +++ b/manifests/cron/archive_deleted_rows.pp @@ -93,33 +93,27 @@ # Defaults to present. # class nova::cron::archive_deleted_rows ( - $minute = 1, - $hour = 0, - $monthday = '*', - $month = '*', - $weekday = '*', - $max_rows = '100', - $user = $::nova::params::user, - $destination = '/var/log/nova/nova-rowsflush.log', - $until_complete = false, - $purge = false, - $age = undef, - $all_cells = false, - $task_log = false, - $sleep = undef, - $verbose = false, - $maxdelay = 0, + $minute = 1, + $hour = 0, + $monthday = '*', + $month = '*', + $weekday = '*', + $max_rows = '100', + $user = $::nova::params::user, + $destination = '/var/log/nova/nova-rowsflush.log', + Boolean $until_complete = false, + Boolean $purge = false, + $age = undef, + Boolean $all_cells = false, + Boolean $task_log = false, + $sleep = undef, + Boolean $verbose = false, + $maxdelay = 0, Enum['present', 'absent'] $ensure = 'present', ) inherits nova::params { include nova::deps - validate_legacy(Boolean, 'validate_bool', $until_complete) - validate_legacy(Boolean, 'validate_bool', $purge) - validate_legacy(Boolean, 'validate_bool', $all_cells) - validate_legacy(Boolean, 'validate_bool', $task_log) - validate_legacy(Boolean, 'validate_bool', $verbose) - if $until_complete { $until_complete_real = ' --until-complete' } diff --git a/manifests/cron/purge_shadow_tables.pp b/manifests/cron/purge_shadow_tables.pp index e33afacd0..f0c8e4ef3 100644 --- a/manifests/cron/purge_shadow_tables.pp +++ b/manifests/cron/purge_shadow_tables.pp @@ -66,26 +66,23 @@ # Defaults to present. # class nova::cron::purge_shadow_tables ( - $minute = 0, - $hour = 5, - $monthday = '*', - $month = '*', - $weekday = '*', - $user = $::nova::params::user, - $destination = '/var/log/nova/nova-rowspurge.log', - $age = 14, - $all_cells = false, - $verbose = false, - $maxdelay = 0, + $minute = 0, + $hour = 5, + $monthday = '*', + $month = '*', + $weekday = '*', + $user = $::nova::params::user, + $destination = '/var/log/nova/nova-rowspurge.log', + $age = 14, + Boolean $all_cells = false, + Boolean $verbose = false, + $maxdelay = 0, Enum['present', 'absent'] $ensure = 'present', ) inherits nova::params { include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $all_cells) - validate_legacy(Boolean, 'validate_bool', $verbose) - if $verbose { $verbose_real = ' --verbose' } diff --git a/manifests/db/mysql.pp b/manifests/db/mysql.pp index 60ce70aa1..56e444976 100644 --- a/manifests/db/mysql.pp +++ b/manifests/db/mysql.pp @@ -37,20 +37,18 @@ # Defaults to true # class nova::db::mysql( - $password, - $dbname = 'nova', - $user = 'nova', - $host = '127.0.0.1', - $charset = 'utf8', - $collate = 'utf8_general_ci', - $allowed_hosts = undef, - $setup_cell0 = true, + String[1] $password, + $dbname = 'nova', + $user = 'nova', + $host = '127.0.0.1', + $charset = 'utf8', + $collate = 'utf8_general_ci', + $allowed_hosts = undef, + Boolean $setup_cell0 = true, ) { include nova::deps - validate_legacy(Boolean, 'validate_bool', $setup_cell0) - ::openstacklib::db::mysql { 'nova': user => $user, password => $password, diff --git a/manifests/db/postgresql.pp b/manifests/db/postgresql.pp index 5412a8c6e..34a52aa8f 100644 --- a/manifests/db/postgresql.pp +++ b/manifests/db/postgresql.pp @@ -30,18 +30,16 @@ # Defaults to true # class nova::db::postgresql( - $password, - $dbname = 'nova', - $user = 'nova', - $encoding = undef, - $privileges = 'ALL', - $setup_cell0 = true, + String[1] $password, + $dbname = 'nova', + $user = 'nova', + $encoding = undef, + $privileges = 'ALL', + Boolean $setup_cell0 = true, ) { include nova::deps - validate_legacy(Boolean, 'validate_bool', $setup_cell0) - ::openstacklib::db::postgresql { 'nova': password => $password, dbname => $dbname, diff --git a/manifests/db/sync_api.pp b/manifests/db/sync_api.pp index 836869db6..149f09f64 100644 --- a/manifests/db/sync_api.pp +++ b/manifests/db/sync_api.pp @@ -22,16 +22,14 @@ # Defaults to 300. # class nova::db::sync_api( - $extra_params = undef, - $cellv2_setup = false, - $db_sync_timeout = 300, + $extra_params = undef, + Boolean $cellv2_setup = false, + $db_sync_timeout = 300, ) { include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $cellv2_setup) - exec { 'nova-db-sync-api': command => "/usr/bin/nova-manage ${extra_params} api_db sync", user => $::nova::params::user, diff --git a/manifests/generic_service.pp b/manifests/generic_service.pp index 9213e9c23..1b35e8d33 100644 --- a/manifests/generic_service.pp +++ b/manifests/generic_service.pp @@ -33,17 +33,14 @@ define nova::generic_service( $package_name, $service_name, - $enabled = true, - $manage_service = true, - $ensure_package = 'present' + Boolean $enabled = true, + Boolean $manage_service = true, + $ensure_package = 'present' ) { include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $manage_service) - $nova_title = "nova-${name}" # I need to mark that ths package should be diff --git a/manifests/init.pp b/manifests/init.pp index ba25c9968..ab45712c5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -413,8 +413,8 @@ class nova( $periodic_interval = '60', $report_interval = '10', $rootwrap_config = '/etc/nova/rootwrap.conf', - $use_ssl = false, - $enabled_ssl_apis = ['metadata', 'osapi_compute'], + Boolean $use_ssl = false, + Array[String[1]] $enabled_ssl_apis = ['metadata', 'osapi_compute'], $ca_file = false, $cert_file = false, $key_file = false, @@ -454,9 +454,6 @@ class nova( include nova::deps include nova::workarounds - validate_legacy(Boolean, 'validate_bool', $use_ssl) - - validate_legacy(Array, 'validate_array', $enabled_ssl_apis) if empty($enabled_ssl_apis) and $use_ssl { warning('enabled_ssl_apis is empty but use_ssl is set to true') } diff --git a/manifests/migration/libvirt.pp b/manifests/migration/libvirt.pp index ce7970e30..bbbefc961 100644 --- a/manifests/migration/libvirt.pp +++ b/manifests/migration/libvirt.pp @@ -149,9 +149,9 @@ # Defaults to undef # class nova::migration::libvirt( - $manage_service = true, - $transport = undef, - $auth = 'none', + Boolean $manage_service = true, + Enum['tcp', 'tls', 'ssh'] $transport = 'tcp', + Enum['sasl', 'none'] $auth = 'none', $listen_address = $facts['os_service_default'], $live_migration_inbound_addr = $facts['os_service_default'], $live_migration_tunnelled = $facts['os_service_default'], @@ -163,46 +163,30 @@ class nova::migration::libvirt( $live_migration_timeout_action = $facts['os_service_default'], $live_migration_permit_post_copy = $facts['os_service_default'], $live_migration_permit_auto_converge = $facts['os_service_default'], - $override_uuid = false, + Boolean $override_uuid = false, $host_uuid = undef, - $configure_libvirt = true, - $configure_nova = true, + Boolean $configure_libvirt = true, + Boolean $configure_nova = true, $client_user = undef, $client_port = undef, $client_extraparams = {}, $ca_file = $facts['os_service_default'], $crl_file = $facts['os_service_default'], $libvirt_version = $::nova::compute::libvirt::version::default, - $modular_libvirt = undef, + Optional[Boolean] $modular_libvirt = undef, ) inherits nova::compute::libvirt::version { include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $override_uuid) - validate_legacy(Boolean, 'validate_bool', $configure_libvirt) - validate_legacy(Boolean, 'validate_bool', $configure_nova) - - if $transport { - $transport_real = $transport - } else { - $transport_real = 'tcp' - } - $modular_libvirt_real = pick($modular_libvirt, $::nova::params::modular_libvirt) if $modular_libvirt_real and !$::nova::params::modular_libvirt_support { fail('Modular libvirt daemons are not supported in this distribution') } - validate_legacy(Enum['tcp', 'tls', 'ssh'], 'validate_re', $transport_real, - [['^tcp$', '^tls$', '^ssh$'], 'Valid options for transport are tcp, tls, ssh.']) - validate_legacy(Enum['sasl', 'none'], 'validate_re', $auth, - [['^sasl$', '^none$'], 'Valid options for auth are none and sasl.']) - if $configure_nova { - if $transport_real == 'ssh' { + if $transport == 'ssh' { if $client_user { $prefix = "${client_user}@" } else { @@ -226,7 +210,7 @@ class nova::migration::libvirt( $extra_params ='' } - $live_migration_uri = "qemu+${transport_real}://${prefix}%s${postfix}/system${extra_params}" + $live_migration_uri = "qemu+${transport}://${prefix}%s${postfix}/system${extra_params}" nova_config { 'libvirt/live_migration_uri': value => $live_migration_uri; @@ -284,12 +268,12 @@ class nova::migration::libvirt( } } - if $transport_real == 'tls' { + if $transport == 'tls' { $auth_tls_real = $auth $auth_tcp_real = $facts['os_service_default'] $ca_file_real = $ca_file $crl_file_real = $crl_file - } elsif $transport_real == 'tcp' { + } elsif $transport == 'tcp' { $auth_tls_real = $facts['os_service_default'] $auth_tcp_real = $auth $ca_file_real = $facts['os_service_default'] @@ -320,7 +304,7 @@ class nova::migration::libvirt( 'listen_addr' => { 'ensure' => absent }, }) - if $transport_real == 'tls' or $transport_real == 'tcp' { + if $transport == 'tls' or $transport == 'tcp' { if versioncmp($libvirt_version, '5.6') < 0 { fail('libvirt version < 5.6 is no longer supported') } @@ -330,7 +314,7 @@ class nova::migration::libvirt( true => 'virtproxyd', default => 'libvirtd', } - $socket_name = "${proxy_service}-${transport_real}" + $socket_name = "${proxy_service}-${transport}" # This is the dummy resource to trigger exec to stop libvirtd.service. # libvirtd.service should be stopped before socket is started. @@ -373,7 +357,7 @@ class nova::migration::libvirt( } else { $listen_address_real = normalize_ip_for_uri($listen_address) - $default_listen_port = $transport_real ? { + $default_listen_port = $transport ? { 'tls' => 16514, default => 16509 } @@ -387,7 +371,7 @@ class nova::migration::libvirt( source => "/usr/lib/systemd/system/${socket_name}.socket", replace => false, require => Anchor['nova::install::end'], - } -> file_line { "${proxy_service}-${transport_real}.socket ListenStream": + } -> file_line { "${proxy_service}-${transport}.socket ListenStream": path => "/etc/systemd/system/${socket_name}.socket", line => "ListenStream=${listen_address_real}:${listen_port}", match => '^ListenStream=.*', @@ -403,9 +387,9 @@ class nova::migration::libvirt( Exec['systemd-damon-reload'] ~> Exec["stop ${proxy_service}.service"] if $modular_libvirt { - Service["${proxy_service}-${transport_real}"] -> Service<| title == 'virtproxyd' |> + Service["${proxy_service}-${transport}"] -> Service<| title == 'virtproxyd' |> } else { - Service["${proxy_service}-${transport_real}"] -> Service<| title == 'libvirt' |> + Service["${proxy_service}-${transport}"] -> Service<| title == 'libvirt' |> } } } diff --git a/manifests/migration/qemu.pp b/manifests/migration/qemu.pp index 6b98eebac..69577c0b5 100644 --- a/manifests/migration/qemu.pp +++ b/manifests/migration/qemu.pp @@ -17,15 +17,13 @@ # Defaults to $facts['os_service_default']. # class nova::migration::qemu( - $configure_qemu = false, - $migration_port_min = $facts['os_service_default'], - $migration_port_max = $facts['os_service_default'], + Boolean $configure_qemu = false, + $migration_port_min = $facts['os_service_default'], + $migration_port_max = $facts['os_service_default'], ){ include nova::deps - validate_legacy(Boolean, 'validate_bool', $configure_qemu) - Qemu_config<||> ~> Service<| tag == 'libvirt-qemu-service' |> if $configure_qemu { diff --git a/manifests/policy.pp b/manifests/policy.pp index ff719f75f..8ec686db5 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -48,7 +48,7 @@ class nova::policy ( $enforce_scope = $facts['os_service_default'], $enforce_new_defaults = $facts['os_service_default'], - $policies = {}, + Hash $policies = {}, $policy_path = '/etc/nova/policy.yaml', $policy_default_rule = $facts['os_service_default'], $policy_dirs = $facts['os_service_default'], @@ -58,8 +58,6 @@ class nova::policy ( include nova::deps include nova::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 71b077c36..6bbaaec2a 100644 --- a/manifests/scheduler.pp +++ b/manifests/scheduler.pp @@ -76,8 +76,8 @@ # Defaults to undef # class nova::scheduler( - $enabled = true, - $manage_service = true, + Boolean $enabled = true, + Boolean $manage_service = true, $ensure_package = 'present', $workers = $facts['os_workers'], $max_attempts = $facts['os_service_default'], @@ -97,9 +97,6 @@ class nova::scheduler( include nova::params include nova::availability_zone - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $manage_service) - if $query_placement_for_availability_zone != undef { warning('The query_placement_for_availability_zone parameter is deprecated.') } diff --git a/manifests/scheduler/filter.pp b/manifests/scheduler/filter.pp index 86e3d2935..c9d742c37 100644 --- a/manifests/scheduler/filter.pp +++ b/manifests/scheduler/filter.pp @@ -102,7 +102,7 @@ class nova::scheduler::filter ( $max_instances_per_host = $facts['os_service_default'], $isolated_images = $facts['os_service_default'], $isolated_hosts = $facts['os_service_default'], - $scheduler_available_filters = ['nova.scheduler.filters.all_filters'], + Array[String[1]] $scheduler_available_filters = ['nova.scheduler.filters.all_filters'], $scheduler_enabled_filters = $facts['os_service_default'], $scheduler_weight_classes = 'nova.scheduler.weights.all_weighers', $track_instance_changes = $facts['os_service_default'], @@ -122,27 +122,18 @@ class nova::scheduler::filter ( include nova::deps - # The following values are following this rule: - # - default is $facts['os_service_default'] so Puppet won't try to configure it. - # - if set, we'll validate it's an array that is not empty and configure the parameter. - # - Otherwise, fallback to default. - - if !is_service_default($scheduler_enabled_filters) and !empty($scheduler_enabled_filters){ - validate_legacy(Array, 'validate_array', $scheduler_enabled_filters) - $scheduler_enabled_filters_real = join($scheduler_enabled_filters, ',') - } else { + if is_service_default($scheduler_enabled_filters) { $scheduler_enabled_filters_real = $facts['os_service_default'] + } elsif empty($scheduler_enabled_filters){ + $scheduler_enabled_filters_real = $facts['os_service_default'] + } else { + $scheduler_enabled_filters_real = join(any2array($scheduler_enabled_filters), ',') } - if $scheduler_available_filters =~ Array { - if empty($scheduler_available_filters) { - $scheduler_available_filters_real = $facts['os_service_default'] - } else { - $scheduler_available_filters_real = $scheduler_available_filters - } + if empty($scheduler_available_filters) { + $scheduler_available_filters_real = $facts['os_service_default'] } else { - warning('scheduler_available_filters must be an array and will fail in the future') - $scheduler_available_filters_real = any2array($scheduler_available_filters) + $scheduler_available_filters_real = $scheduler_available_filters } nova_config { diff --git a/manifests/serialproxy.pp b/manifests/serialproxy.pp index ad2c4b1a4..c0bdd7937 100644 --- a/manifests/serialproxy.pp +++ b/manifests/serialproxy.pp @@ -25,19 +25,16 @@ # Defaults to 'present' # class nova::serialproxy( - $enabled = true, - $manage_service = true, - $serialproxy_host = '0.0.0.0', - $serialproxy_port = '6083', - $ensure_package = 'present' + Boolean $enabled = true, + Boolean $manage_service = true, + $serialproxy_host = '0.0.0.0', + $serialproxy_port = '6083', + $ensure_package = 'present' ) { include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $enabled) - nova_config { 'serial_console/serialproxy_port': value => $serialproxy_port; 'serial_console/serialproxy_host': value => $serialproxy_host; diff --git a/manifests/spicehtml5proxy.pp b/manifests/spicehtml5proxy.pp index f997c40a8..eadf62463 100644 --- a/manifests/spicehtml5proxy.pp +++ b/manifests/spicehtml5proxy.pp @@ -29,19 +29,16 @@ # Defaults to 'present' # class nova::spicehtml5proxy( - $enabled = true, - $manage_service = true, - $host = '0.0.0.0', - $port = '6082', - $ensure_package = 'present' + Boolean $enabled = true, + Boolean $manage_service = true, + $host = '0.0.0.0', + $port = '6082', + $ensure_package = 'present' ) { include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $manage_service) - # Nodes running spicehtml5proxy do *not* need (and in fact, don't care) # about [spice]/enable to be set. This setting is for compute nodes, # where we must select VNC or SPICE so that it can be passed on to diff --git a/manifests/vendordata.pp b/manifests/vendordata.pp index 168242363..b9500a9c9 100644 --- a/manifests/vendordata.pp +++ b/manifests/vendordata.pp @@ -94,15 +94,13 @@ class nova::vendordata( include nova::deps if !is_service_default($vendordata_providers) and !empty($vendordata_providers){ - validate_legacy(Array, 'validate_array', $vendordata_providers) - $vendordata_providers_real = join($vendordata_providers, ',') + $vendordata_providers_real = join(any2array($vendordata_providers), ',') } else { $vendordata_providers_real = $facts['os_service_default'] } if !is_service_default($vendordata_dynamic_targets) and !empty($vendordata_dynamic_targets){ - validate_legacy(Array, 'validate_array', $vendordata_dynamic_targets) - $vendordata_dynamic_targets_real = join($vendordata_dynamic_targets, ',') + $vendordata_dynamic_targets_real = join(any2array($vendordata_dynamic_targets), ',') } else { $vendordata_dynamic_targets_real = $facts['os_service_default'] } diff --git a/manifests/vncproxy.pp b/manifests/vncproxy.pp index 88ae6d3c2..f84fcf4cd 100644 --- a/manifests/vncproxy.pp +++ b/manifests/vncproxy.pp @@ -62,28 +62,23 @@ # Defaults to undef # class nova::vncproxy( - $enabled = true, - $manage_service = true, - $vncproxy_protocol = 'http', - $host = '0.0.0.0', - $port = '6080', - $vncproxy_path = '/vnc_auto.html', - $ensure_package = 'present', - $allow_noauth = true, - $allow_vencrypt = false, - $vencrypt_key = undef, - $vencrypt_cert = undef, - $vencrypt_ca = undef, + Boolean $enabled = true, + Boolean $manage_service = true, + $vncproxy_protocol = 'http', + $host = '0.0.0.0', + $port = '6080', + $vncproxy_path = '/vnc_auto.html', + $ensure_package = 'present', + Boolean $allow_noauth = true, + Boolean $allow_vencrypt = false, + $vencrypt_key = undef, + $vencrypt_cert = undef, + $vencrypt_ca = undef, ) { include nova::deps include nova::params - validate_legacy(Boolean, 'validate_bool', $enabled) - validate_legacy(Boolean, 'validate_bool', $manage_service) - validate_legacy(Boolean, 'validate_bool', $allow_noauth) - validate_legacy(Boolean, 'validate_bool', $allow_vencrypt) - if (!$allow_noauth and !$allow_vencrypt) { fail('Either allow_noauth or allow_vencrypt must be true') }