Add purge_config option
Add the option in order to facilitate management. User can ensure that only the options they hoped are configured. Change-Id: Ia123c54d26ef4a242b69db691c18705e23eb9999
This commit is contained in:
parent
126dec773d
commit
19c4199606
|
@ -90,24 +90,30 @@
|
|||
# value)
|
||||
# Defaults to false
|
||||
#
|
||||
# [*purge_config*]
|
||||
# (optional) Whether to set only the specified config options
|
||||
# in the glare config.
|
||||
# Defaults to false.
|
||||
#
|
||||
class glare (
|
||||
$package_ensure = 'present',
|
||||
$bind_host = $::os_service_default,
|
||||
$bind_port = $::os_service_default,
|
||||
$backlog = $::os_service_default,
|
||||
$workers = $::os_workers,
|
||||
$auth_strategy = 'keystone',
|
||||
$pipeline = 'keystone',
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$cert_file = $::os_service_default,
|
||||
$key_file = $::os_service_default,
|
||||
$ca_file = $::os_service_default,
|
||||
$stores = $::os_service_default,
|
||||
$default_store = $::os_service_default,
|
||||
$filesystem_store_datadir = '/var/lib/glare/images',
|
||||
$os_region_name = 'RegionOne',
|
||||
$allow_anonymous_access = $::os_service_default,
|
||||
$package_ensure = 'present',
|
||||
$bind_host = $::os_service_default,
|
||||
$bind_port = $::os_service_default,
|
||||
$backlog = $::os_service_default,
|
||||
$workers = $::os_workers,
|
||||
$auth_strategy = 'keystone',
|
||||
$pipeline = 'keystone',
|
||||
$manage_service = true,
|
||||
$enabled = true,
|
||||
$cert_file = $::os_service_default,
|
||||
$key_file = $::os_service_default,
|
||||
$ca_file = $::os_service_default,
|
||||
$stores = $::os_service_default,
|
||||
$default_store = $::os_service_default,
|
||||
$filesystem_store_datadir = '/var/lib/glare/images',
|
||||
$os_region_name = 'RegionOne',
|
||||
$allow_anonymous_access = $::os_service_default,
|
||||
$purge_config = false,
|
||||
) {
|
||||
include ::glare::params
|
||||
include ::glare::db
|
||||
|
@ -120,6 +126,10 @@ class glare (
|
|||
tag => ['openstack', 'glare-package'],
|
||||
})
|
||||
|
||||
resources { 'glare_config':
|
||||
purge => $purge_config,
|
||||
}
|
||||
|
||||
glare_config {
|
||||
'DEFAULT/bind_host' : value => $bind_host;
|
||||
'DEFAULT/bind_port' : value => $bind_port;
|
||||
|
|
|
@ -5,21 +5,26 @@ describe 'glare' do
|
|||
shared_examples 'glare' do
|
||||
|
||||
context 'with default parameters' do
|
||||
let :pre_condition do
|
||||
"class { '::glare::keystone::authtoken':
|
||||
password => 'ChangeMe' }"
|
||||
end
|
||||
it 'contains the params class' do
|
||||
is_expected.to contain_class('glare::params')
|
||||
end
|
||||
let :params do
|
||||
{ :purge_config => false }
|
||||
end
|
||||
|
||||
it 'contains the db class' do
|
||||
is_expected.to contain_class('glare::db')
|
||||
end
|
||||
let :pre_condition do
|
||||
"class { '::glare::keystone::authtoken':
|
||||
password => 'ChangeMe' }"
|
||||
end
|
||||
|
||||
it 'contains the logging class' do
|
||||
is_expected.to contain_class('glare::logging')
|
||||
end
|
||||
it 'contains the params class' do
|
||||
is_expected.to contain_class('glare::params')
|
||||
end
|
||||
|
||||
it 'contains the db class' do
|
||||
is_expected.to contain_class('glare::db')
|
||||
end
|
||||
|
||||
it 'contains the logging class' do
|
||||
is_expected.to contain_class('glare::logging')
|
||||
end
|
||||
|
||||
it 'installs package' do
|
||||
is_expected.to contain_package('glare').with(
|
||||
|
@ -28,6 +33,12 @@ describe 'glare' do
|
|||
)
|
||||
end
|
||||
|
||||
it 'passes purge to resource' do
|
||||
is_expected.to contain_resources('glare_config').with({
|
||||
:purge => false
|
||||
})
|
||||
end
|
||||
|
||||
it { is_expected.to contain_glare_config('DEFAULT/bind_host').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glare_config('DEFAULT/bind_port').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_glare_config('DEFAULT/backlog').with_value('<SERVICE DEFAULT>') }
|
||||
|
@ -52,9 +63,9 @@ describe 'glare' do
|
|||
end
|
||||
|
||||
it { is_expected.to contain_service('glare').with(
|
||||
'ensure' => 'running',
|
||||
'name' => platform_params[:glare_service_name],
|
||||
'enable' => true,
|
||||
'ensure' => 'running',
|
||||
'name' => platform_params[:glare_service_name],
|
||||
'enable' => true,
|
||||
) }
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue