Files
puppet-ceilometer/manifests/db/sync.pp
Takashi Kajinami 1ebfb2c40e Prepare for new lint plugins
This fixes a few lint warnings/errors detected by the following plugins
we aim to enable soon.
 - puppet-lint-file_ensure-check
 - puppet-lint-trailing_comma-check
 - puppet-lint-topscope-variable-check

Change-Id: I3ec372b6771012ea3b50521f142e5c3411694dca
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
2025-08-15 20:01:34 +09:00

53 lines
1.4 KiB
Puppet

# == Class: ceilometer::db::sync
#
# Class to execute ceilometer database schema creation
#
# === Parameters:
#
# [*extra_params*]
# (Optional) String of extra command line parameters
# to append to the ceilometer-upgrade command.
# Defaults to undef.
#
# [*db_sync_timeout*]
# (Optional) Timeout for the execution of the db_sync
# Defaults to 300
#
# [*skip_gnocchi_resource_types*]
# (Optional) Skip gnocchi resource-types upgrade.
# Defaults to false
#
class ceilometer::db::sync(
$extra_params = undef,
$db_sync_timeout = 300,
Boolean $skip_gnocchi_resource_types = false,
) {
include ceilometer::deps
include ceilometer::params
$skip_opt = $skip_gnocchi_resource_types ? {
true => '--skip-gnocchi-resource-types ',
default => ''
}
exec { 'ceilometer-upgrade':
command => "${ceilometer::params::dbsync_command} ${skip_opt}${extra_params}",
path => '/usr/bin',
user => $ceilometer::params::user,
refreshonly => true,
try_sleep => 5,
tries => 10,
timeout => $db_sync_timeout,
logoutput => on_failure,
subscribe => [
Anchor['ceilometer::install::end'],
Anchor['ceilometer::config::end'],
Anchor['ceilometer::dbsync::begin']
],
notify => Anchor['ceilometer::dbsync::end'],
tag => 'openstack-db',
}
}