puppet-gnocchi/manifests/db.pp
Takashi Kajinami 3bf5d9ed3c Refactor resource dependencies
This refactors resource dependencies to improve the following points.

 - Avoid unnecessary dependencies across services. For example aodh
   service does not require cinder db.

 - Restart only api service when config files like paste.ini, which
   are used only be api service is changed.

Change-Id: Ib89091baaf9aba0809c2e9405389545168b755ec
2024-03-01 12:23:19 +09:00

36 lines
948 B
Puppet

# == Class: gnocchi::db
#
# Configure the Gnocchi database
#
# === Parameters
#
# [*database_connection*]
# Url used to connect to database.
# (Optional) Defaults to 'sqlite:////var/lib/gnocchi/gnocchi.sqlite'.
#
# [*package_ensure*]
# (optional) The state of gnocchi packages
# Defaults to 'present'
#
class gnocchi::db (
Oslo::DBconn $database_connection = 'sqlite:////var/lib/gnocchi/gnocchi.sqlite',
$package_ensure = 'present',
) inherits gnocchi::params {
include gnocchi::deps
oslo::db { 'gnocchi_config':
connection => $database_connection,
backend_package_ensure => $package_ensure,
manage_config => false,
}
gnocchi_config {
'indexer/url': value => $database_connection, secret => true;
}
# all db settings should be applied and all packages should be installed
# before dbsync starts
Oslo::Db['gnocchi_config'] -> Anchor['gnocchi::dbsync::begin']
}