replace validate_legacy with proper data types
the validate_legacy function is marked for deprecation in v9.0.0 from puppetlabs-stdlib. Change-Id: I8656f4aba542881afa68966cc63bd8c085b52bda
This commit is contained in:
parent
41268f3493
commit
0827ad6fc3
@ -94,32 +94,26 @@
|
|||||||
# override this to notifier:// instead.
|
# override this to notifier:// instead.
|
||||||
#
|
#
|
||||||
class ceilometer::agent::notification (
|
class ceilometer::agent::notification (
|
||||||
$manage_service = true,
|
Boolean $manage_service = true,
|
||||||
$enabled = true,
|
Boolean $enabled = true,
|
||||||
$ack_on_event_error = $facts['os_service_default'],
|
$ack_on_event_error = $facts['os_service_default'],
|
||||||
$disable_non_metric_meters = $facts['os_service_default'],
|
$disable_non_metric_meters = $facts['os_service_default'],
|
||||||
$workers = $facts['os_service_default'],
|
$workers = $facts['os_service_default'],
|
||||||
$messaging_urls = $facts['os_service_default'],
|
$messaging_urls = $facts['os_service_default'],
|
||||||
$batch_size = $facts['os_service_default'],
|
$batch_size = $facts['os_service_default'],
|
||||||
$batch_timeout = $facts['os_service_default'],
|
$batch_timeout = $facts['os_service_default'],
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$manage_event_pipeline = false,
|
Boolean $manage_event_pipeline = false,
|
||||||
$event_pipeline_publishers = ['gnocchi://'],
|
Array[String[1]] $event_pipeline_publishers = ['gnocchi://'],
|
||||||
$event_pipeline_config = undef,
|
Optional[Hash] $event_pipeline_config = undef,
|
||||||
$manage_pipeline = false,
|
Boolean $manage_pipeline = false,
|
||||||
$pipeline_publishers = ['gnocchi://'],
|
Array[String[1]] $pipeline_publishers = ['gnocchi://'],
|
||||||
$pipeline_config = undef,
|
Optional[Hash] $pipeline_config = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ceilometer::deps
|
include ceilometer::deps
|
||||||
include ceilometer::params
|
include ceilometer::params
|
||||||
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $enabled)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $manage_event_pipeline)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $manage_pipeline)
|
|
||||||
|
|
||||||
|
|
||||||
package { 'ceilometer-notification':
|
package { 'ceilometer-notification':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
name => $::ceilometer::params::agent_notification_package_name,
|
name => $::ceilometer::params::agent_notification_package_name,
|
||||||
@ -145,10 +139,8 @@ class ceilometer::agent::notification (
|
|||||||
|
|
||||||
if $manage_event_pipeline {
|
if $manage_event_pipeline {
|
||||||
if $event_pipeline_config {
|
if $event_pipeline_config {
|
||||||
validate_legacy(Hash, 'validate_hash', $event_pipeline_config)
|
|
||||||
$event_pipeline_content = to_yaml($event_pipeline_config)
|
$event_pipeline_content = to_yaml($event_pipeline_config)
|
||||||
} else {
|
} else {
|
||||||
validate_legacy(Array, 'validate_array', $event_pipeline_publishers)
|
|
||||||
$event_pipeline_content = template('ceilometer/event_pipeline.yaml.erb')
|
$event_pipeline_content = template('ceilometer/event_pipeline.yaml.erb')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,10 +158,8 @@ class ceilometer::agent::notification (
|
|||||||
|
|
||||||
if $manage_pipeline {
|
if $manage_pipeline {
|
||||||
if $pipeline_config {
|
if $pipeline_config {
|
||||||
validate_legacy(Hash, 'validate_hash', $pipeline_config)
|
|
||||||
$pipeline_content = to_yaml($pipeline_config)
|
$pipeline_content = to_yaml($pipeline_config)
|
||||||
} else {
|
} else {
|
||||||
validate_legacy(Array, 'validate_array', $pipeline_publishers)
|
|
||||||
$pipeline_content = template('ceilometer/pipeline.yaml.erb')
|
$pipeline_content = template('ceilometer/pipeline.yaml.erb')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,37 +82,28 @@
|
|||||||
# Defaults to $facts['os_service_default'].
|
# Defaults to $facts['os_service_default'].
|
||||||
#
|
#
|
||||||
class ceilometer::agent::polling (
|
class ceilometer::agent::polling (
|
||||||
$manage_service = true,
|
Boolean $manage_service = true,
|
||||||
$enabled = true,
|
Boolean $enabled = true,
|
||||||
$separate_services = false,
|
Boolean $separate_services = false,
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$manage_user = true,
|
Boolean $manage_user = true,
|
||||||
$central_namespace = true,
|
Boolean $central_namespace = true,
|
||||||
$compute_namespace = true,
|
Boolean $compute_namespace = true,
|
||||||
$ipmi_namespace = true,
|
Boolean $ipmi_namespace = true,
|
||||||
$instance_discovery_method = $facts['os_service_default'],
|
$instance_discovery_method = $facts['os_service_default'],
|
||||||
$resource_update_interval = $facts['os_service_default'],
|
$resource_update_interval = $facts['os_service_default'],
|
||||||
$resource_cache_expiry = $facts['os_service_default'],
|
$resource_cache_expiry = $facts['os_service_default'],
|
||||||
$manage_polling = false,
|
Boolean $manage_polling = false,
|
||||||
$polling_interval = 600,
|
$polling_interval = 600,
|
||||||
$polling_meters = $::ceilometer::params::polling_meters,
|
$polling_meters = $::ceilometer::params::polling_meters,
|
||||||
$polling_config = undef,
|
Optional[Hash]$polling_config = undef,
|
||||||
$batch_size = $facts['os_service_default'],
|
$batch_size = $facts['os_service_default'],
|
||||||
$tenant_name_discovery = $facts['os_service_default'],
|
$tenant_name_discovery = $facts['os_service_default'],
|
||||||
) inherits ceilometer {
|
) inherits ceilometer {
|
||||||
|
|
||||||
include ceilometer::deps
|
include ceilometer::deps
|
||||||
include ceilometer::params
|
include ceilometer::params
|
||||||
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $manage_service)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $enabled)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $separate_services)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $manage_user)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $central_namespace)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $compute_namespace)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $ipmi_namespace)
|
|
||||||
validate_legacy(Boolean, 'validate_bool', $manage_polling)
|
|
||||||
|
|
||||||
if $central_namespace {
|
if $central_namespace {
|
||||||
$central_namespace_name = 'central'
|
$central_namespace_name = 'central'
|
||||||
ceilometer_config {
|
ceilometer_config {
|
||||||
@ -280,7 +271,6 @@ class ceilometer::agent::polling (
|
|||||||
|
|
||||||
if $manage_polling {
|
if $manage_polling {
|
||||||
if $polling_config {
|
if $polling_config {
|
||||||
validate_legacy(Hash, 'validate_hash', $polling_config)
|
|
||||||
$polling_content = to_yaml($polling_config)
|
$polling_content = to_yaml($polling_config)
|
||||||
} else {
|
} else {
|
||||||
$polling_content = template('ceilometer/polling.yaml.erb')
|
$polling_content = template('ceilometer/polling.yaml.erb')
|
||||||
|
@ -26,15 +26,12 @@
|
|||||||
# or Puppet catalog compilation will fail with duplicate resources.
|
# or Puppet catalog compilation will fail with duplicate resources.
|
||||||
#
|
#
|
||||||
class ceilometer::config (
|
class ceilometer::config (
|
||||||
$ceilometer_config = {},
|
Hash $ceilometer_config = {},
|
||||||
$ceilometer_rootwrap_config = {},
|
Hash $ceilometer_rootwrap_config = {},
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ceilometer::deps
|
include ceilometer::deps
|
||||||
|
|
||||||
validate_legacy(Hash, 'validate_hash', $ceilometer_config)
|
|
||||||
validate_legacy(Hash, 'validate_hash', $ceilometer_rootwrap_config)
|
|
||||||
|
|
||||||
create_resources('ceilometer_config', $ceilometer_config)
|
create_resources('ceilometer_config', $ceilometer_config)
|
||||||
create_resources('ceilometer_rootwrap_config', $ceilometer_rootwrap_config)
|
create_resources('ceilometer_rootwrap_config', $ceilometer_rootwrap_config)
|
||||||
|
|
||||||
|
@ -50,22 +50,20 @@
|
|||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
class ceilometer::keystone::auth (
|
class ceilometer::keystone::auth (
|
||||||
$password = false,
|
String[1] $password,
|
||||||
$email = 'ceilometer@localhost',
|
$email = 'ceilometer@localhost',
|
||||||
$auth_name = 'ceilometer',
|
$auth_name = 'ceilometer',
|
||||||
$configure_user = true,
|
$configure_user = true,
|
||||||
$configure_user_role = true,
|
$configure_user_role = true,
|
||||||
$region = 'RegionOne',
|
$region = 'RegionOne',
|
||||||
$tenant = 'services',
|
$tenant = 'services',
|
||||||
$roles = ['admin'],
|
$roles = ['admin'],
|
||||||
$system_scope = 'all',
|
$system_scope = 'all',
|
||||||
$system_roles = [],
|
$system_roles = [],
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ceilometer::deps
|
include ceilometer::deps
|
||||||
|
|
||||||
validate_legacy(String, 'validate_string', $password)
|
|
||||||
|
|
||||||
# Ceilometer requires only its user, project, and role assignment.
|
# Ceilometer requires only its user, project, and role assignment.
|
||||||
# service and endpoint should be disabled since ceilometer-api has been removed.
|
# service and endpoint should be disabled since ceilometer-api has been removed.
|
||||||
keystone::resource::service_identity { 'ceilometer':
|
keystone::resource::service_identity { 'ceilometer':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user