coordination: Allow disabling management of backend package
... which is already implemented in other resources like oslo::cache. Change-Id: I459b7b752a83f75b1cb05c2104812133039a9162
This commit is contained in:
3 changed files with 74 additions and 4 deletions
@@ -8,6 +8,10 @@
#(Optional)CoordinationbackendURL.
#Defaultsto$::os_service_default
#
#[*manage_backend_package*]
#(Optional)Whethertoinstallthebackendpackage.
#Defaultstotrue.
#
#[*package_ensure*]
#(Optional)ensurestateforpackage.
#Defaultsto'present'
@@ -17,14 +21,15 @@
#Defaultstotrue.
#
defineoslo::coordination(
$backend_url=$::os_service_default,
$package_ensure='present',
$manage_config=true,
$backend_url =$::os_service_default,
$manage_backend_package=true,
$package_ensure='present',
$manage_config=true,
){
include oslo::params
if !is_service_default($backend_url){
if $manage_backend_package and !is_service_default($backend_url){
case $backend_url {
/^redis:\/\//: {
ensure_packages('python-redis', {
@@ -0,0 +1,5 @@
---
features:
- |
The ``oslo::coordination::manage_backend_package`` parameter has been
added.
@@ -26,6 +26,18 @@ describe 'oslo::coordination' do
:tag => 'openstack',
)
end
context 'with backend package management disabled' do
before do
params.merge!({
:manage_backend_package => false,
})
end
it 'does not install backend package' do
is_expected.to_not contain_package('python-redis')
end
end
end
context 'with etcd3 backend' do
@@ -46,6 +58,18 @@ describe 'oslo::coordination' do
is_expected.to_not contain_package('python-etcd3')
end
end
context 'with backend package management disabled' do
before do
params.merge!({
:manage_backend_package => false,
})
end
it 'does not install backend package' do
is_expected.to_not contain_package('python-etcd3')
end
end
end
context 'with etcd3gw backend(http)' do
@@ -57,6 +81,18 @@ describe 'oslo::coordination' do
is_expected.to contain_keystone_config('coordination/backend_url').with_value('etcd3+http://localhost:2379')
is_expected.to contain_package('python-etcd3gw')
end
context 'with backend package management disabled' do
before do
params.merge!({
:manage_backend_package => false,
})
end
it 'does not install backend package' do
is_expected.to_not contain_package('python-etcd3gw')
end
end
end
context 'with etcd3gw backend(https)' do
@@ -68,6 +104,18 @@ describe 'oslo::coordination' do
is_expected.to contain_keystone_config('coordination/backend_url').with_value('etcd3+https://localhost:2379')
is_expected.to contain_package('python-etcd3gw')
end
context 'with backend package management disabled' do
before do
params.merge!({
:manage_backend_package => false,
})
end
it 'does not install backend package' do
is_expected.to_not contain_package('python-etcd3gw')
end
end
end
context 'with memcache backend' do
@@ -84,6 +132,18 @@ describe 'oslo::coordination' do
:tag => 'openstack',
)
end
context 'with backend package management disabled' do
before do
params.merge!({
:manage_backend_package => false,
})
end
it 'does not install backend package' do
is_expected.to_not contain_package('python-pymemcache')
end
end
end
context 'with configuration management disabled' do
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.