aodh-evaluator: Require redis backend

The aodh-evaluator service requires valid tooz backend so that tasks
are distributed properly among multiple nodes. This change ensures
redis vip and password are defined in hieradata so that coordination
backend can always be configured properly.

Change-Id: I4ff71ee1a2a38c225b0d8f70c3fc757e014abdaf
This commit is contained in:
Takashi Kajinami 2022-04-22 08:26:17 +09:00
parent cf3e7b2c23
commit 7a195e69ef
2 changed files with 15 additions and 6 deletions

View File

@ -24,11 +24,11 @@
#
# [*aodh_redis_password*]
# (Optional) redis password to configure coordination url
# Defaults to lookup('aodh_redis_password', undef, undef, undef)
# Defaults to lookup('aodh_redis_password')
#
# [*redis_vip*]
# (Optional) redis vip to configure coordination url
# Defaults to lookup('redis_vip', undef, undef, undef)
# Defaults to lookup('redis_vip')
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
@ -37,8 +37,8 @@
#
class tripleo::profile::base::aodh::evaluator (
$enable_internal_tls = lookup('enable_internal_tls', undef, undef, false),
$aodh_redis_password = lookup('aodh_redis_password', undef, undef, undef),
$redis_vip = lookup('redis_vip', undef, undef, undef),
$aodh_redis_password = lookup('aodh_redis_password'),
$redis_vip = lookup('redis_vip'),
$step = Integer(lookup('step')),
) {

View File

@ -19,11 +19,20 @@ require 'spec_helper'
describe 'tripleo::profile::base::aodh::evaluator' do
shared_examples_for 'tripleo::profile::base::aodh::evaluator' do
let(:pre_condition) do
"class { 'tripleo::profile::base::aodh': step => #{params[:step]}, oslomsg_rpc_hosts => ['localhost.localdomain'] }"
<<-eos
class { 'tripleo::profile::base::aodh':
step => #{params[:step]},
oslomsg_rpc_hosts => ['localhost.localdomain']
}
eos
end
context 'with step less than 4' do
let(:params) { { :step => 3 } }
let(:params) { {
:step => 3,
:aodh_redis_password => 'password',
:redis_vip => '127.0.0.1',
} }
it 'should do nothing' do
is_expected.to contain_class('tripleo::profile::base::aodh::evaluator')