diff --git a/manifests/profile/base/ceilometer/collector.pp b/manifests/profile/base/ceilometer/collector.pp index 09a959824..3d9986edc 100644 --- a/manifests/profile/base/ceilometer/collector.pp +++ b/manifests/profile/base/ceilometer/collector.pp @@ -100,5 +100,16 @@ class tripleo::profile::base::ceilometer::collector ( try_sleep => 5, tries => 10 } + + # NOTE(sileht): Ensure we run before ceilometer-agent-notification and + # ceilometer-collector rare started and after gnocchi-api is running + include ::gnocchi::deps + Anchor['gnocchi::service::end'] + ~> Exec['ceilometer-db-upgrade'] + ~> Service<| title == 'ceilometer-collector' |> + ~> Service<| title == 'ceilometer-agent-notification' |> + # NOTE(sileht): We can't depends on Anchor['ceilometer::service::begin'] + # directly because that will depends on ceilometer-api and creates a dep + # loops across httpd, so we directly depends on the Services } } diff --git a/manifests/profile/base/gnocchi/api.pp b/manifests/profile/base/gnocchi/api.pp index 2626c7a69..18a483e70 100644 --- a/manifests/profile/base/gnocchi/api.pp +++ b/manifests/profile/base/gnocchi/api.pp @@ -102,23 +102,32 @@ class tripleo::profile::base::gnocchi::api ( $tls_keyfile = undef } - if $step >= 4 and $sync_db { - include ::gnocchi::db::sync - } - if $step >= 4 or ($step >= 3 and $sync_db) { + if $sync_db { + # NOTE(sileht): We upgrade only the database on step 3. + # the storage will be updated on step4 when swift is ready + if ($step == 3 and $gnocchi_backend == 'swift') { + $db_sync_extra_opts = '--skip-storage' + } else { + $db_sync_extra_opts = undef + } + + class { '::gnocchi::db::sync': + extra_opts => $db_sync_extra_opts, + } + } + include ::gnocchi::api include ::apache::mod::ssl class { '::gnocchi::wsgi::apache': ssl_cert => $tls_certfile, ssl_key => $tls_keyfile, } - } - if $step >= 4 { class { '::gnocchi::storage': coordination_url => join(['redis://:', $gnocchi_redis_password, '@', normalize_ip_for_uri($redis_vip), ':6379/']), } + case $gnocchi_backend { 'swift': { include ::gnocchi::storage::swift