coordination: Allow disabling management of backend package
... which is implemented in other resources like oslo::cache. Change-Id: I459b7b752a83f75b1cb05c2104812133039a9162
This commit is contained in:
parent
b05244e2a1
commit
b66d8ea26d
|
@ -8,6 +8,10 @@
|
||||||
# (Optional) Coordination backend URL.
|
# (Optional) Coordination backend URL.
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
|
# [*manage_backend_package*]
|
||||||
|
# (Optional) Whether to install the backend package.
|
||||||
|
# Defaults to true.
|
||||||
|
#
|
||||||
# [*package_ensure*]
|
# [*package_ensure*]
|
||||||
# (Optional) ensure state for package.
|
# (Optional) ensure state for package.
|
||||||
# Defaults to 'present'
|
# Defaults to 'present'
|
||||||
|
@ -17,14 +21,15 @@
|
||||||
# Defaults to true.
|
# Defaults to true.
|
||||||
#
|
#
|
||||||
define oslo::coordination (
|
define oslo::coordination (
|
||||||
$backend_url = $::os_service_default,
|
$backend_url = $::os_service_default,
|
||||||
$package_ensure = 'present',
|
$manage_backend_package = true,
|
||||||
$manage_config = true,
|
$package_ensure = 'present',
|
||||||
|
$manage_config = true,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include oslo::params
|
include oslo::params
|
||||||
|
|
||||||
if !is_service_default($backend_url) {
|
if $manage_backend_package and !is_service_default($backend_url){
|
||||||
case $backend_url {
|
case $backend_url {
|
||||||
/^redis:\/\//: {
|
/^redis:\/\//: {
|
||||||
ensure_packages('python-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',
|
:tag => 'openstack',
|
||||||
)
|
)
|
||||||
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-redis')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with etcd3 backend' do
|
context 'with etcd3 backend' do
|
||||||
|
@ -46,6 +58,18 @@ describe 'oslo::coordination' do
|
||||||
is_expected.to_not contain_package('python-etcd3')
|
is_expected.to_not contain_package('python-etcd3')
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
context 'with etcd3gw backend(http)' do
|
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_keystone_config('coordination/backend_url').with_value('etcd3+http://localhost:2379')
|
||||||
is_expected.to contain_package('python-etcd3gw')
|
is_expected.to contain_package('python-etcd3gw')
|
||||||
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-etcd3gw')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with etcd3gw backend(https)' do
|
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_keystone_config('coordination/backend_url').with_value('etcd3+https://localhost:2379')
|
||||||
is_expected.to contain_package('python-etcd3gw')
|
is_expected.to contain_package('python-etcd3gw')
|
||||||
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-etcd3gw')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with memcache backend' do
|
context 'with memcache backend' do
|
||||||
|
@ -84,6 +132,18 @@ describe 'oslo::coordination' do
|
||||||
:tag => 'openstack',
|
:tag => 'openstack',
|
||||||
)
|
)
|
||||||
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-pymemcache')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with configuration management disabled' do
|
context 'with configuration management disabled' do
|
||||||
|
|
Loading…
Reference in New Issue