Merge "coordination: disable config management"

This commit is contained in:
Zuul 2021-08-24 08:59:25 +00:00 committed by Gerrit Code Review
commit 1e6b40e31b
2 changed files with 27 additions and 3 deletions

View File

@ -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)
}

View File

@ -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({