2018-03-23 11:28:57 +08:00
|
|
|
# Configure the Gnocchi service
|
2018-03-21 09:32:56 +08:00
|
|
|
#
|
|
|
|
# [*integration_enable*]
|
|
|
|
# (optional) Boolean to run integration tests.
|
|
|
|
# Defaults to true.
|
|
|
|
#
|
|
|
|
class openstack_integration::gnocchi (
|
|
|
|
$integration_enable = true,
|
|
|
|
){
|
2016-01-25 17:20:16 -05:00
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
include openstack_integration::config
|
|
|
|
include openstack_integration::params
|
2016-03-29 20:51:03 -04:00
|
|
|
|
2017-05-04 09:39:10 +02:00
|
|
|
if $::openstack_integration::config::ssl {
|
|
|
|
openstack_integration::ssl_key { 'gnocchi':
|
|
|
|
notify => Service['httpd'],
|
|
|
|
require => Package['gnocchi'],
|
2016-03-29 20:51:03 -04:00
|
|
|
}
|
2017-05-04 09:39:10 +02:00
|
|
|
Exec['update-ca-certificates'] ~> Service['httpd']
|
|
|
|
}
|
2016-03-29 20:51:03 -04:00
|
|
|
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::logging':
|
2018-11-27 23:24:00 +01:00
|
|
|
debug => true,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi':
|
2017-05-04 09:39:10 +02:00
|
|
|
database_connection => 'mysql+pymysql://gnocchi:gnocchi@127.0.0.1/gnocchi?charset=utf8',
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::db::mysql':
|
2017-05-04 09:39:10 +02:00
|
|
|
password => 'gnocchi',
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::keystone::auth':
|
2017-05-04 09:39:10 +02:00
|
|
|
public_url => "${::openstack_integration::config::base_url}:8041",
|
|
|
|
internal_url => "${::openstack_integration::config::base_url}:8041",
|
|
|
|
admin_url => "${::openstack_integration::config::base_url}:8041",
|
|
|
|
password => 'a_big_secret',
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::keystone::authtoken':
|
2018-04-24 20:27:18 +08:00
|
|
|
password => 'a_big_secret',
|
|
|
|
user_domain_name => 'Default',
|
|
|
|
project_domain_name => 'Default',
|
|
|
|
auth_url => $::openstack_integration::config::keystone_admin_uri,
|
|
|
|
www_authenticate_uri => $::openstack_integration::config::keystone_auth_uri,
|
|
|
|
memcached_servers => $::openstack_integration::config::memcached_servers,
|
2017-05-04 09:39:10 +02:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::api':
|
2017-05-04 09:39:10 +02:00
|
|
|
enabled => true,
|
|
|
|
service_name => 'httpd',
|
|
|
|
sync_db => true,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
include apache
|
|
|
|
class { 'gnocchi::wsgi::apache':
|
2017-05-04 09:39:10 +02:00
|
|
|
bind_host => $::openstack_integration::config::ip_for_url,
|
|
|
|
ssl => $::openstack_integration::config::ssl,
|
|
|
|
ssl_key => "/etc/gnocchi/ssl/private/${::fqdn}.pem",
|
|
|
|
ssl_cert => $::openstack_integration::params::cert_path,
|
|
|
|
workers => 2,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::client': }
|
|
|
|
class { 'gnocchi::metricd':
|
2017-07-04 13:45:41 -07:00
|
|
|
workers => 2,
|
|
|
|
# because we configure Keystone to expire tokens after 600s, we don't
|
|
|
|
# want to rely on default value in Gnocchi which is 300s to cleanup old data.
|
|
|
|
# Indeed, Gnocchi might use an old token that expired to clean up and then it would
|
|
|
|
# fail. It happens when running Tempest tests in the gate with low resources.
|
|
|
|
# Production value (300) shouldn't be changed by default.
|
|
|
|
cleanup_delay => 10,
|
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::storage':
|
2016-12-14 12:05:34 -05:00
|
|
|
# NOTE(sileht): Since we set the pipeline interval to 1 minutes instead
|
|
|
|
# of 10, we must compute metrics more often too, otherwise Aodh alarms will
|
|
|
|
# always missed data just because they are 'not yet' computed.
|
|
|
|
metric_processing_delay => 5,
|
|
|
|
coordination_url => $::openstack_integration::config::tooz_url,
|
2017-05-04 09:39:10 +02:00
|
|
|
}
|
2018-03-21 09:32:56 +08:00
|
|
|
if $integration_enable {
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::storage::ceph':
|
2018-03-21 09:32:56 +08:00
|
|
|
ceph_username => 'openstack',
|
|
|
|
ceph_keyring => '/etc/ceph/ceph.client.openstack.keyring',
|
|
|
|
manage_cradox => ($::osfamily == 'RedHat'),
|
|
|
|
manage_rados => ($::osfamily == 'Debian'),
|
|
|
|
}
|
|
|
|
# make sure ceph pool exists before running gnocchi (dbsync & services)
|
|
|
|
Exec['create-gnocchi'] -> Exec['gnocchi-db-sync']
|
|
|
|
} else {
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::storage::file': }
|
2017-05-04 09:39:10 +02:00
|
|
|
}
|
2019-12-08 12:59:28 +01:00
|
|
|
class { 'gnocchi::statsd':
|
2017-05-04 09:39:10 +02:00
|
|
|
archive_policy_name => 'high',
|
|
|
|
flush_delay => '100',
|
|
|
|
# random datas:
|
|
|
|
resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9',
|
2016-01-25 17:20:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|