Merge "Add gnocchi::config class"
This commit is contained in:
commit
dc2a8521b4
|
@ -0,0 +1,30 @@
|
|||
# == Class: gnocchi::config
|
||||
#
|
||||
# This class is used to manage arbitrary Gnocchi configurations.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*gnocchi_config*]
|
||||
# (optional) Allow configuration of arbitrary Gnocchi configurations.
|
||||
# The value is an hash of gnocchi_config resources. Example:
|
||||
# { 'DEFAULT/foo' => { value => 'fooValue'},
|
||||
# 'DEFAULT/bar' => { value => 'barValue'}
|
||||
# }
|
||||
# In yaml format, Example:
|
||||
# gnocchi_config:
|
||||
# DEFAULT/foo:
|
||||
# value: fooValue
|
||||
# DEFAULT/bar:
|
||||
# value: barValue
|
||||
#
|
||||
# NOTE: The configuration MUST NOT be already handled by this module
|
||||
# or Puppet catalog compilation will fail with duplicate resources.
|
||||
#
|
||||
class gnocchi::config (
|
||||
$gnocchi_config = {},
|
||||
) {
|
||||
|
||||
validate_hash($gnocchi_config)
|
||||
|
||||
create_resources('gnocchi_config', $gnocchi_config)
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'gnocchi::config' do
|
||||
|
||||
let :params do
|
||||
{ :gnocchi_config => {
|
||||
'DEFAULT/foo' => { 'value' => 'fooValue' },
|
||||
'DEFAULT/bar' => { 'value' => 'barValue' },
|
||||
'DEFAULT/baz' => { 'ensure' => 'absent' }
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures arbitrary gnocchi configurations' do
|
||||
is_expected.to contain_gnocchi_config('DEFAULT/foo').with_value('fooValue')
|
||||
is_expected.to contain_gnocchi_config('DEFAULT/bar').with_value('barValue')
|
||||
is_expected.to contain_gnocchi_config('DEFAULT/baz').with_ensure('absent')
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue