coordination: Expose parameters for package management
Change-Id: I78b811af8ef82f1a6e4b2a9cc024901ca4e1f7bb Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -23,16 +23,28 @@
|
|||||||
# group
|
# group
|
||||||
# Defaults to $facts['os_service_default']
|
# Defaults to $facts['os_service_default']
|
||||||
#
|
#
|
||||||
|
# [*manage_backend_package*]
|
||||||
|
# (Optional) Whether to install the backend package.
|
||||||
|
# Defaults to true.
|
||||||
|
#
|
||||||
|
# [*package_ensure*]
|
||||||
|
# (Optional) ensure state for package.
|
||||||
|
# Defaults to 'present'
|
||||||
|
#
|
||||||
class aodh::coordination (
|
class aodh::coordination (
|
||||||
$backend_url = $facts['os_service_default'],
|
$backend_url = $facts['os_service_default'],
|
||||||
$heartbeat_interval = $facts['os_service_default'],
|
$heartbeat_interval = $facts['os_service_default'],
|
||||||
$retry_backoff = $facts['os_service_default'],
|
$retry_backoff = $facts['os_service_default'],
|
||||||
$max_retry_interval = $facts['os_service_default'],
|
$max_retry_interval = $facts['os_service_default'],
|
||||||
|
Boolean $manage_backend_package = true,
|
||||||
|
Stdlib::Ensure::Package $package_ensure = present,
|
||||||
) {
|
) {
|
||||||
include aodh::deps
|
include aodh::deps
|
||||||
|
|
||||||
oslo::coordination { 'aodh_config':
|
oslo::coordination { 'aodh_config':
|
||||||
backend_url => $backend_url,
|
backend_url => $backend_url,
|
||||||
|
manage_backend_package => $manage_backend_package,
|
||||||
|
package_ensure => $package_ensure,
|
||||||
}
|
}
|
||||||
|
|
||||||
aodh_config {
|
aodh_config {
|
||||||
|
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The following parameters have been added to the ``aodh::coordination``
|
||||||
|
class.
|
||||||
|
|
||||||
|
- ``manage_backend_package``
|
||||||
|
- ``package_ensure``
|
@@ -5,7 +5,9 @@ describe 'aodh::coordination' do
|
|||||||
context 'with default parameters' do
|
context 'with default parameters' do
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_oslo__coordination('aodh_config').with(
|
is_expected.to contain_oslo__coordination('aodh_config').with(
|
||||||
:backend_url => '<SERVICE DEFAULT>'
|
:backend_url => '<SERVICE DEFAULT>',
|
||||||
|
:manage_backend_package => true,
|
||||||
|
:package_ensure => 'present',
|
||||||
)
|
)
|
||||||
is_expected.to contain_aodh_config('coordination/heartbeat_interval').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_aodh_config('coordination/heartbeat_interval').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_aodh_config('coordination/retry_backoff').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_aodh_config('coordination/retry_backoff').with_value('<SERVICE DEFAULT>')
|
||||||
@@ -16,16 +18,20 @@ describe 'aodh::coordination' do
|
|||||||
context 'with specified parameters' do
|
context 'with specified parameters' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:backend_url => 'etcd3+http://127.0.0.1:2379',
|
:backend_url => 'etcd3+http://127.0.0.1:2379',
|
||||||
:heartbeat_interval => 1,
|
:heartbeat_interval => 1,
|
||||||
:retry_backoff => 1,
|
:retry_backoff => 1,
|
||||||
:max_retry_interval => 30,
|
:max_retry_interval => 30,
|
||||||
|
:manage_backend_package => false,
|
||||||
|
:package_ensure => 'latest',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it {
|
it {
|
||||||
is_expected.to contain_oslo__coordination('aodh_config').with(
|
is_expected.to contain_oslo__coordination('aodh_config').with(
|
||||||
:backend_url => 'etcd3+http://127.0.0.1:2379'
|
:backend_url => 'etcd3+http://127.0.0.1:2379',
|
||||||
|
:manage_backend_package => false,
|
||||||
|
:package_ensure => 'latest',
|
||||||
)
|
)
|
||||||
is_expected.to contain_aodh_config('coordination/heartbeat_interval').with_value(1)
|
is_expected.to contain_aodh_config('coordination/heartbeat_interval').with_value(1)
|
||||||
is_expected.to contain_aodh_config('coordination/retry_backoff').with_value(1)
|
is_expected.to contain_aodh_config('coordination/retry_backoff').with_value(1)
|
||||||
|
Reference in New Issue
Block a user