diff --git a/manifests/db/sync.pp b/manifests/db/sync.pp index 0fa39261..ad8ef89e 100644 --- a/manifests/db/sync.pp +++ b/manifests/db/sync.pp @@ -13,16 +13,26 @@ # (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, + $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} ${extra_params}", + command => "${::ceilometer::params::dbsync_command} ${skip_opt}${extra_params}", path => '/usr/bin', user => $::ceilometer::params::user, refreshonly => true, diff --git a/releasenotes/notes/skip_gnocchi_resource_types-57c99651aa2d3b99.yaml b/releasenotes/notes/skip_gnocchi_resource_types-57c99651aa2d3b99.yaml new file mode 100644 index 00000000..2e429119 --- /dev/null +++ b/releasenotes/notes/skip_gnocchi_resource_types-57c99651aa2d3b99.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``ceilometer::db::sync::skip_gnocchi_resource_types`` parameter has + been added. diff --git a/spec/classes/ceilometer_db_sync_spec.rb b/spec/classes/ceilometer_db_sync_spec.rb index a6305704..a65b76f5 100644 --- a/spec/classes/ceilometer_db_sync_spec.rb +++ b/spec/classes/ceilometer_db_sync_spec.rb @@ -27,13 +27,14 @@ describe 'ceilometer::db::sync' do describe 'overriding params' do let :params do { - :extra_params => '--config-file=/etc/ceilometer/ceilometer_01.conf', - :db_sync_timeout => 750, + :extra_params => '--config-file=/etc/ceilometer/ceilometer_01.conf', + :skip_gnocchi_resource_types => true, + :db_sync_timeout => 750, } end it { is_expected.to contain_exec('ceilometer-upgrade').with( - :command => 'ceilometer-upgrade --config-file=/etc/ceilometer/ceilometer_01.conf', + :command => 'ceilometer-upgrade --skip-gnocchi-resource-types --config-file=/etc/ceilometer/ceilometer_01.conf', :path => '/usr/bin', :user => 'ceilometer', :refreshonly => 'true',