Use validate_legacy
This changes all the puppet 3 validate_* functions to use the validate_legacy function. The validate_legacy function has been available since about three years but require Puppet >= 4.4.0 and since there is Puppet 4.10.12 as latest we should assume people are running a fairly new Puppet 4 version. This is the first step to then remove all validate function calls and use proper types for parameter as described in spec [1]. [1] https://review.openstack.org/#/c/568929/ Change-Id: Iee8c082b5e4dcb7b035faa56a2182718947ad495
This commit is contained in:
parent
105e75fcfd
commit
a07db29002
|
@ -58,7 +58,7 @@ class tripleo::cluster::cassandra(
|
||||||
# https://tickets.puppetlabs.com/browse/PUP-1299
|
# https://tickets.puppetlabs.com/browse/PUP-1299
|
||||||
#
|
#
|
||||||
# validate_array($cassandra_servers)
|
# validate_array($cassandra_servers)
|
||||||
validate_ipv4_address($cassandra_ip)
|
validate_legacy(Stdlib::IP::Address::V4, 'validate_ipv4_address', $cassandra_ip)
|
||||||
|
|
||||||
class {'::cassandra':
|
class {'::cassandra':
|
||||||
cluster_name => 'TripleO',
|
cluster_name => 'TripleO',
|
||||||
|
|
|
@ -44,7 +44,7 @@ class tripleo::cluster::zookeeper(
|
||||||
# https://tickets.puppetlabs.com/browse/PUP-1299
|
# https://tickets.puppetlabs.com/browse/PUP-1299
|
||||||
|
|
||||||
# validate_array($zookeeper_server_ips)
|
# validate_array($zookeeper_server_ips)
|
||||||
validate_ipv4_address($zookeeper_client_ip)
|
validate_legacy(Stdlib::IP::Address::V4, 'validate_ipv4_address', $zookeeper_client_ip)
|
||||||
# validate_array($zookeeper_hostnames)
|
# validate_array($zookeeper_hostnames)
|
||||||
|
|
||||||
# TODO(devvesa) Zookeeper package should provide these paths,
|
# TODO(devvesa) Zookeeper package should provide these paths,
|
||||||
|
|
|
@ -145,8 +145,8 @@ define tripleo::firewall::rule (
|
||||||
|
|
||||||
$ipv4_rule = merge($basic, $state_rule, $extras)
|
$ipv4_rule = merge($basic, $state_rule, $extras)
|
||||||
$ipv6_rule = merge($basic, $state_rule, $ipv6, $extras)
|
$ipv6_rule = merge($basic, $state_rule, $ipv6, $extras)
|
||||||
validate_hash($ipv4_rule)
|
validate_legacy(Hash, 'validate_hash', $ipv4_rule)
|
||||||
validate_hash($ipv6_rule)
|
validate_legacy(Hash, 'validate_hash', $ipv6_rule)
|
||||||
|
|
||||||
# This conditional will ensure that TCP and UDP firewall rules have
|
# This conditional will ensure that TCP and UDP firewall rules have
|
||||||
# a port specified in the configuration when using INPUT or OUTPUT chains.
|
# a port specified in the configuration when using INPUT or OUTPUT chains.
|
||||||
|
|
|
@ -28,7 +28,7 @@ class tripleo::host::liquidio::config (
|
||||||
$liquidio_config = {}
|
$liquidio_config = {}
|
||||||
) {
|
) {
|
||||||
|
|
||||||
validate_hash($liquidio_config)
|
validate_legacy(Hash, 'validate_hash', $liquidio_config)
|
||||||
|
|
||||||
create_resources('liquidio_config', $liquidio_config)
|
create_resources('liquidio_config', $liquidio_config)
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,9 +251,10 @@ class tripleo::network::contrail::config(
|
||||||
$zk_server_ip = hiera('contrail_database_node_ips'),
|
$zk_server_ip = hiera('contrail_database_node_ips'),
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
validate_ip_address($listen_ip_address)
|
|
||||||
validate_ip_address($disc_server_ip)
|
validate_legacy(Stdlib::IP::Address, 'validate_ip_address', $listen_ip_address)
|
||||||
validate_ip_address($ifmap_server_ip)
|
validate_legacy(Stdlib::IP::Address, 'validate_ip_address', $disc_server_ip)
|
||||||
|
validate_legacy(Stdlib::IP::Address, 'validate_ip_address', $ifmap_server_ip)
|
||||||
$basicauthusers_property_control = map($control_server_list) |$item| { "${item}.control:${item}.control" }
|
$basicauthusers_property_control = map($control_server_list) |$item| { "${item}.control:${item}.control" }
|
||||||
$basicauthusers_property_dns = $control_server_list.map |$item| { "${item}.dns:${item}.dns" }
|
$basicauthusers_property_dns = $control_server_list.map |$item| { "${item}.dns:${item}.dns" }
|
||||||
$basicauthusers_property = concat($basicauthusers_property_control, $basicauthusers_property_dns)
|
$basicauthusers_property = concat($basicauthusers_property_control, $basicauthusers_property_dns)
|
||||||
|
|
|
@ -123,7 +123,7 @@ class tripleo::network::contrail::neutron_plugin (
|
||||||
include ::neutron::deps
|
include ::neutron::deps
|
||||||
include ::neutron::params
|
include ::neutron::params
|
||||||
|
|
||||||
validate_array($contrail_extensions)
|
validate_legacy(Array, 'validate_array', $contrail_extensions)
|
||||||
|
|
||||||
package { 'neutron-plugin-contrail':
|
package { 'neutron-plugin-contrail':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
|
|
|
@ -51,7 +51,7 @@ define tripleo::profile::base::aide::rules (
|
||||||
{
|
{
|
||||||
fail('$order must be a string or an integer')
|
fail('$order must be a string or an integer')
|
||||||
}
|
}
|
||||||
validate_string($body)
|
validate_legacy(String, 'validate_string', $body)
|
||||||
|
|
||||||
concat::fragment{ "aide_fragment_${name}":
|
concat::fragment{ "aide_fragment_${name}":
|
||||||
target => 'aide.conf',
|
target => 'aide.conf',
|
||||||
|
|
|
@ -116,8 +116,8 @@ class tripleo::profile::base::database::mysql (
|
||||||
$sync_db = false
|
$sync_db = false
|
||||||
}
|
}
|
||||||
|
|
||||||
validate_hash($mysql_server_options)
|
validate_legacy(Hash, 'validate_hash', $mysql_server_options)
|
||||||
validate_hash($certificate_specs)
|
validate_legacy(Hash, 'validate_hash', $certificate_specs)
|
||||||
|
|
||||||
if $enable_internal_tls {
|
if $enable_internal_tls {
|
||||||
$tls_certfile = $certificate_specs['service_certificate']
|
$tls_certfile = $certificate_specs['service_certificate']
|
||||||
|
|
|
@ -48,7 +48,7 @@ define tripleo::profile::base::database::mysql::user (
|
||||||
$allowed_hosts = undef
|
$allowed_hosts = undef
|
||||||
) {
|
) {
|
||||||
|
|
||||||
validate_string($password)
|
validate_legacy(String, 'validate_string', $password)
|
||||||
|
|
||||||
::openstacklib::db::mysql { $title :
|
::openstacklib::db::mysql { $title :
|
||||||
user => $user,
|
user => $user,
|
||||||
|
|
|
@ -65,7 +65,7 @@ class tripleo::profile::base::etcd (
|
||||||
$step = Integer(hiera('step')),
|
$step = Integer(hiera('step')),
|
||||||
) {
|
) {
|
||||||
|
|
||||||
validate_hash($certificate_specs)
|
validate_legacy(Hash, 'validate_hash', $certificate_specs)
|
||||||
|
|
||||||
if $enable_internal_tls {
|
if $enable_internal_tls {
|
||||||
$tls_certfile = $certificate_specs['service_certificate']
|
$tls_certfile = $certificate_specs['service_certificate']
|
||||||
|
|
|
@ -261,7 +261,7 @@ class tripleo::profile::base::keystone (
|
||||||
include ::keystone::security_compliance
|
include ::keystone::security_compliance
|
||||||
|
|
||||||
if $ldap_backend_enable {
|
if $ldap_backend_enable {
|
||||||
validate_hash($ldap_backends_config)
|
validate_legacy(Hash, 'validate_hash', $ldap_backends_config)
|
||||||
if !str2bool($::selinux) {
|
if !str2bool($::selinux) {
|
||||||
selboolean { 'authlogin_nsswitch_use_ldap':
|
selboolean { 'authlogin_nsswitch_use_ldap':
|
||||||
value => on,
|
value => on,
|
||||||
|
|
|
@ -49,7 +49,7 @@ class tripleo::profile::base::neutron::opendaylight (
|
||||||
$enable_internal_tls = hiera('enable_internal_tls', false),
|
$enable_internal_tls = hiera('enable_internal_tls', false),
|
||||||
) {
|
) {
|
||||||
|
|
||||||
validate_hash($certificate_specs)
|
validate_legacy(Hash, 'validate_hash', $certificate_specs)
|
||||||
|
|
||||||
if $enable_internal_tls {
|
if $enable_internal_tls {
|
||||||
$tls_certfile = $certificate_specs['service_certificate']
|
$tls_certfile = $certificate_specs['service_certificate']
|
||||||
|
@ -60,7 +60,7 @@ class tripleo::profile::base::neutron::opendaylight (
|
||||||
}
|
}
|
||||||
|
|
||||||
if $step >= 1 {
|
if $step >= 1 {
|
||||||
validate_array($odl_api_ips)
|
validate_legacy(Array, 'validate_array', $odl_api_ips)
|
||||||
if empty($odl_api_ips) {
|
if empty($odl_api_ips) {
|
||||||
fail('No IPs assigned to OpenDaylight Api Service')
|
fail('No IPs assigned to OpenDaylight Api Service')
|
||||||
} elsif size($odl_api_ips) == 2 {
|
} elsif size($odl_api_ips) == 2 {
|
||||||
|
|
|
@ -52,10 +52,14 @@ class tripleo::profile::base::nova::migration::target (
|
||||||
|
|
||||||
include ::tripleo::profile::base::nova::migration
|
include ::tripleo::profile::base::nova::migration
|
||||||
|
|
||||||
validate_array($ssh_localaddrs)
|
validate_legacy(Array, 'validate_array', $ssh_localaddrs)
|
||||||
$ssh_localaddrs.each |$x| { validate_ip_address($x) }
|
|
||||||
|
$ssh_localaddrs.each |$x| {
|
||||||
|
validate_legacy(Stdlib::IP::Address, 'validate_ip_address', $x)
|
||||||
|
}
|
||||||
|
|
||||||
$ssh_localaddrs_real = unique($ssh_localaddrs)
|
$ssh_localaddrs_real = unique($ssh_localaddrs)
|
||||||
validate_array($ssh_authorized_keys)
|
validate_legacy(Array, 'validate_array', $ssh_authorized_keys)
|
||||||
$ssh_authorized_keys_real = join($ssh_authorized_keys, '\n')
|
$ssh_authorized_keys_real = join($ssh_authorized_keys, '\n')
|
||||||
|
|
||||||
if $step >= 4 {
|
if $step >= 4 {
|
||||||
|
|
|
@ -32,7 +32,8 @@ class tripleo::profile::base::securetty (
|
||||||
$step = Integer(hiera('step')),
|
$step = Integer(hiera('step')),
|
||||||
$tty_list = hiera('tty_list', []),
|
$tty_list = hiera('tty_list', []),
|
||||||
) {
|
) {
|
||||||
validate_array($tty_list)
|
|
||||||
|
validate_legacy(Array, 'validate_array', $tty_list)
|
||||||
|
|
||||||
if $step >=1 {
|
if $step >=1 {
|
||||||
$ttys = join($tty_list, "\n")
|
$ttys = join($tty_list, "\n")
|
||||||
|
|
|
@ -57,7 +57,7 @@ class tripleo::profile::base::snmp (
|
||||||
authpass => $snmpd_password,
|
authpass => $snmpd_password,
|
||||||
}
|
}
|
||||||
if $snmpd_config {
|
if $snmpd_config {
|
||||||
validate_array($snmpd_config)
|
validate_legacy(Array, 'validate_array', $snmpd_config)
|
||||||
class { '::snmp':
|
class { '::snmp':
|
||||||
snmpd_config => $snmpd_config,
|
snmpd_config => $snmpd_config,
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ class tripleo::profile::base::swift::ringbuilder (
|
||||||
}
|
}
|
||||||
|
|
||||||
if $step >= 3 {
|
if $step >= 3 {
|
||||||
validate_bool($build_ring)
|
validate_legacy(Boolean, 'validate_bool', $build_ring)
|
||||||
|
|
||||||
if $build_ring {
|
if $build_ring {
|
||||||
if $devices {
|
if $devices {
|
||||||
|
|
Loading…
Reference in New Issue