Add incoming storage driver param

We need a way to not enable redis incoming driver in tls
case. Lets expose a param to override the default
behavior.

Depends-On: I5b71099d2e1c25b86ceed430f15ee28ef0f37f5c

Change-Id: I63ba2735912ee5f8f5880bba6e4320f2eaa51f92
This commit is contained in:
Pradeep Kilambi 2017-11-30 11:22:45 -05:00
parent bf906de5b1
commit 98afac08bf
2 changed files with 27 additions and 4 deletions

View File

@ -64,6 +64,10 @@
# for more details.
# Defaults to hiera('step')
#
# [*incoming_storage_driver*]
# (Optional) Storage driver to use for incoming metric data
# Defaults to hiera('incoming_storage_driver', undef)
#
class tripleo::profile::base::gnocchi::api (
$bootstrap_node = hiera('bootstrap_nodeid', undef),
$certificates_specs = hiera('apache_certificates_specs', {}),
@ -74,6 +78,7 @@ class tripleo::profile::base::gnocchi::api (
$redis_vip = hiera('redis_vip'),
$gnocchi_rbd_client_name = hiera('gnocchi::storage::ceph::ceph_username','openstack'),
$step = Integer(hiera('step')),
$incoming_storage_driver = hiera('incoming_storage_driver', undef),
) {
if $::hostname == downcase($bootstrap_node) {
$sync_db = true
@ -120,8 +125,10 @@ class tripleo::profile::base::gnocchi::api (
coordination_url => join(['redis://:', $gnocchi_redis_password, '@', normalize_ip_for_uri($redis_vip), ':6379/']),
}
class { '::gnocchi::storage::incoming::redis':
redis_url => join(['redis://:', $gnocchi_redis_password, '@', normalize_ip_for_uri($redis_vip), ':6379/']),
if $incoming_storage_driver == 'redis' {
class { '::gnocchi::storage::incoming::redis':
redis_url => join(['redis://:', $gnocchi_redis_password, '@', normalize_ip_for_uri($redis_vip), ':6379/']),
}
}
case $gnocchi_backend {

View File

@ -75,7 +75,8 @@ describe 'tripleo::profile::base::gnocchi::api' do
:step => 4,
:gnocchi_backend => 'file',
:gnocchi_redis_password => 'gnocchi',
:redis_vip => '127.0.0.1'
:redis_vip => '127.0.0.1',
:incoming_storage_driver => 'redis',
} }
it {
@ -97,7 +98,8 @@ describe 'tripleo::profile::base::gnocchi::api' do
:gnocchi_backend => 'rbd',
:gnocchi_redis_password => 'gnocchi',
:redis_vip => '127.0.0.1',
:gnocchi_rbd_client_name => 'openstack'
:gnocchi_rbd_client_name => 'openstack',
:incoming_storage_driver => 'redis',
} }
it {
@ -114,6 +116,20 @@ describe 'tripleo::profile::base::gnocchi::api' do
}
end
context 'skip incoming storage in step 4' do
let(:params) { {
:step => 4,
:gnocchi_backend => 'rbd',
:gnocchi_redis_password => 'gnocchi',
:redis_vip => '127.0.0.1',
:incoming_storage_driver => '',
} }
it {
is_expected.not_to contain_class('gnocchi::storage::incoming::redis')
}
end
context 'with step 5 on bootstrap' do
let(:params) { {
:step => 5,