Run ceilometer-upgrade for gnocchi conditionally

Currently we skip the gnocchi resource types by default when
ceilometer::db is called. Instead invoke ceilometer-upgrade
when gnocchi service is up and running conditionally.

Closes-bug: #1674421

Change-Id: Ib4c8c3295c5a8d34827b81b27c0818ddbfb549b6
This commit is contained in:
Pradeep Kilambi 2017-03-22 15:38:12 -04:00
parent 85109b5944
commit fb4a1fb030
3 changed files with 29 additions and 1 deletions

View File

@ -27,7 +27,6 @@ Exec<| title == 'nova-db-sync-api' |> { refreshonly => false }
Exec<| title == 'nova-db-sync' |> { refreshonly => false }
Exec<| title == 'nova-db-online-data-migrations' |> { refreshonly => false }
Exec<| title == 'heat-dbsync' |> { refreshonly => false }
Exec<| title == 'ceilometer-dbsync' |> { refreshonly => false }
Exec<| title == 'aodh-db-sync' |> { refreshonly => false }
Exec<| title == 'ironic-dbsync' |> { refreshonly => false }
Exec<| title == 'mistral-db-sync' |> { refreshonly => false }
@ -180,6 +179,30 @@ if str2bool(hiera('enable_telemetry', true)) {
include ::ceilometer::agent::auth
include ::ceilometer::dispatcher::gnocchi
# We need to use exec as the keystone dependency wouldnt allow
# us to wait until service is up before running upgrade. This
# is because both keystone, gnocchi and ceilometer run under apache.
exec { 'ceilo-gnocchi-upgrade':
command => 'ceilometer-upgrade --skip-metering-database',
path => ['/usr/bin', '/usr/sbin'],
}
# This ensures we can do service validation on gnocchi api before
# running ceilometer-upgrade
$command = join(['curl -s',
hiera('gnocchi_healthcheck_url')], ' ')
openstacklib::service_validation { 'gnocchi-status':
command => $command,
tries => 20,
refreshonly => true,
subscribe => Anchor['gnocchi::service::end']
}
# Ensure all endpoint exists and only then run the upgrade.
Keystone::Resource::Service_identity<||> ->
Openstacklib::Service_validation['gnocchi-status'] -> Exec['ceilo-gnocchi-upgrade']
Cron <| title == 'ceilometer-expirer' |> { command =>
"sleep $((\$(od -A n -t d -N 3 /dev/urandom) % 86400)) && ${::ceilometer::params::expirer_command}" }

View File

@ -348,6 +348,7 @@ gnocchi::statsd::user_id: '27c0d3f8-e7ee-42f0-8317-72237d1c5ae3'
gnocchi::statsd::project_id: '6c38cd8d-099a-4cb2-aecf-17be688e8616'
gnocchi::statsd::flush_delay: 10
gnocchi::statsd::archive_policy_name: 'low'
gnocchi_healthcheck_url: {{UNDERCLOUD_ENDPOINT_GNOCCHI_PUBLIC}}/healthcheck
# Panko
panko::logging::debug: "%{hiera('debug')}"

View File

@ -0,0 +1,4 @@
---
fixes:
- Run ceilometer-upgrade conditionally when gnocchi is running so that
gnocchi resource types are created.