From 09ece82775b9fef17bd5ae0d7991c8972431bd31 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 21 May 2021 17:14:18 +0900 Subject: [PATCH] coordination: disable config management It turned out that Gnocchi uses the different parameter name to define coordination backend. This change introduces a flag to disable managmeent of coordination parameters so that we can implement that management in specific manifets. Change-Id: I9eccb6b727f67d1e7b74f886e8c08562f1824aba --- manifests/coordination.pp | 13 ++++++++++--- spec/defines/oslo_coordination_spec.rb | 17 +++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/manifests/coordination.pp b/manifests/coordination.pp index 1c5ba2d..85643ca 100644 --- a/manifests/coordination.pp +++ b/manifests/coordination.pp @@ -12,9 +12,14 @@ # (Optional) ensure state for package. # Defaults to 'present' # +# [*manage_config*] +# (Optional) Whether to manage the configuration parameters. +# Defaults to true. +# define oslo::coordination ( $backend_url = $::os_service_default, $package_ensure = 'present', + $manage_config = true, ) { include oslo::params @@ -59,8 +64,10 @@ define oslo::coordination ( } } - $coordination_options = { - 'coordination/backend_url' => { value => $backend_url }, + if $manage_config { + $coordination_options = { + 'coordination/backend_url' => { value => $backend_url }, + } + create_resources($name, $coordination_options) } - create_resources($name, $coordination_options) } diff --git a/spec/defines/oslo_coordination_spec.rb b/spec/defines/oslo_coordination_spec.rb index 1e3f86a..92936f5 100644 --- a/spec/defines/oslo_coordination_spec.rb +++ b/spec/defines/oslo_coordination_spec.rb @@ -85,6 +85,23 @@ describe 'oslo::coordination' do ) end end + + context 'with configuration management disabled' do + let :params do + { :backend_url => 'redis://localhost:6379', + :manage_config => false } + end + + it 'manages only packages' do + is_expected.to_not contain_keystone_config('coordination/backend_url') + + is_expected.to contain_package('python-redis').with( + :name => platform_params[:python_redis_package_name], + :ensure => 'present', + :tag => 'openstack', + ) + end + end end on_supported_os({