From 558ab6a54a71f37e5c4d32f8bb84c502011d052c Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 22 Jan 2022 23:15:39 +0900 Subject: [PATCH] Enable Telemetry service in scenario002 ... to test usage of Swift backend in Gnocchi. Change-Id: I993ce7a4870dc84745e391872b6165bfdbc56053 --- README.md | 8 +++--- fixtures/scenario002.pp | 11 +++++++ manifests/gnocchi.pp | 63 ++++++++++++++++++++++++++++++++++------- 3 files changed, 68 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 173b6ebaa..7b335b7cb 100644 --- a/README.md +++ b/README.md @@ -53,11 +53,11 @@ scenario](#all-in-one). | placement | | X | X | X | X | X | | neutron | | ovs | ovs | linuxbridge | ovs | ovs | | cinder | | rbd | iscsi | | | iscsi | -| ceilometer | | X | | | | | -| aodh | | X | | | | | +| ceilometer | | X | X | | | | +| aodh | | X | X | | | | | designate | | | | bind | | | | backup | | | swift | | | | -| gnocchi | | rbd | | | | | +| gnocchi | | rbd | swift | | | | | ec2api | | | X | | | | | heat | | X | | X | | | | swift | | | X | | | | @@ -76,7 +76,7 @@ scenario](#all-in-one). | watcher | | | | | X | | | bgpvpn-api | | | | | X | | | bgp-dr | | | | | X | | -| redis | | X | | | | | +| redis | | X | X | | | | | l2gw | | | | | X | | | om rpc | amqp1 | amqp1 | rabbit | rabbit | rabbit | rabbit | | om notify | rabbit | rabbit | rabbit | rabbit | rabbit | rabbit | diff --git a/fixtures/scenario002.pp b/fixtures/scenario002.pp index c9f33ffbb..3e8d2d8e7 100644 --- a/fixtures/scenario002.pp +++ b/fixtures/scenario002.pp @@ -75,9 +75,20 @@ if $ec2api_enabled { include openstack_integration::ec2api } +include openstack_integration::ceilometer +include openstack_integration::aodh +include openstack_integration::redis +class { 'openstack_integration::gnocchi': + integration_enable => true, + backend => 'swift' +} + class { 'openstack_integration::tempest': + aodh => true, + ceilometer => true, cinder => true, cinder_backup => true, + gnocchi => true, swift => true, ironic => true, zaqar => true, diff --git a/manifests/gnocchi.pp b/manifests/gnocchi.pp index 334db0216..b8182ca78 100644 --- a/manifests/gnocchi.pp +++ b/manifests/gnocchi.pp @@ -1,10 +1,16 @@ # Configure the Gnocchi service # +# [*backend*] +# (optional) Backend storage to be used. This is overridden by 'file' when +# integration_enable is false. +# Defaults to 'ceph'. +# # [*integration_enable*] # (optional) Boolean to run integration tests. # Defaults to true. # class openstack_integration::gnocchi ( + $backend = 'ceph', $integration_enable = true, ){ @@ -19,6 +25,12 @@ class openstack_integration::gnocchi ( Exec['update-ca-certificates'] ~> Service['httpd'] } + if ! $integration_enable { + $backend_real = 'file' + } else { + $backend_real = $backend + } + class { 'gnocchi::logging': debug => true, } @@ -32,6 +44,20 @@ class openstack_integration::gnocchi ( charset => $::openstack_integration::params::mysql_charset, password => 'gnocchi', } + + # TODO(tkajinam): We need to find a way to enforce swift is up before + # starting all services. Currently it results in dependency + # cycle, caused by multiple usage of httpd. In the mean time + # skip initializing storage for swift, because the current + # implementation only validates connection to swift. + $db_sync_extra_opts = $backend_real ? { + 'swift' => '--skip-storage', + default => undef, + } + class { 'gnocchi::db::sync': + extra_opts => $db_sync_extra_opts, + } + class { 'gnocchi::keystone::auth': public_url => "${::openstack_integration::config::base_url}:8041", internal_url => "${::openstack_integration::config::base_url}:8041", @@ -49,7 +75,6 @@ class openstack_integration::gnocchi ( class { 'gnocchi::api': enabled => true, service_name => 'httpd', - sync_db => true, } include apache class { 'gnocchi::wsgi::apache': @@ -74,16 +99,34 @@ class openstack_integration::gnocchi ( metric_processing_delay => 5, } class { 'gnocchi::storage': } - if $integration_enable { - class { 'gnocchi::storage::ceph': - ceph_username => 'openstack', - ceph_keyring => '/etc/ceph/ceph.client.openstack.keyring', - manage_rados => true, + + case $backend_real { + 'ceph': { + class { 'gnocchi::storage::ceph': + ceph_username => 'openstack', + ceph_keyring => '/etc/ceph/ceph.client.openstack.keyring', + manage_rados => true, + } + # make sure ceph pool exists before running gnocchi (dbsync & services) + Exec['create-gnocchi'] -> Exec['gnocchi-db-sync'] + } + 'swift': { + class { 'gnocchi::storage::swift': + swift_auth_version => '2', + swift_authurl => $::openstack_integration::config::keystone_admin_uri, + swift_user => 'services:gnocchi', + swift_key => 'a_big_secret', + } + class { 'gnocchi::storage::incoming::redis': + redis_url => $::openstack_integration::config::tooz_url, + } + } + 'file': { + class { 'gnocchi::storage::file': } + } + default: { + fail("Unsupported backend (${backend})") } - # make sure ceph pool exists before running gnocchi (dbsync & services) - Exec['create-gnocchi'] -> Exec['gnocchi-db-sync'] - } else { - class { 'gnocchi::storage::file': } } class { 'gnocchi::statsd': archive_policy_name => 'high',