Add support for [DEFAULT] host
... so that users can override this parameter to use static hostname rather than the one deteted by socket.gethostname(). Change-Id: I909e40692aaa2b7a23a0efe8ff5a0392e8fe7293
This commit is contained in:
parent
01e72cbb9a
commit
54545aacb6
|
@ -12,6 +12,10 @@
|
|||
# (optional) Name of the package containing shared resources
|
||||
# Defaults to $::designate::params::common_package_name
|
||||
#
|
||||
# [*host*]
|
||||
# (Optional) Name of this node.
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*root_helper*]
|
||||
# (optional) Command for designate rootwrap helper.
|
||||
# Defaults to 'sudo designate-rootwrap /etc/designate/rootwrap.conf'.
|
||||
|
@ -109,6 +113,7 @@
|
|||
class designate(
|
||||
$package_ensure = present,
|
||||
$common_package_name = $::designate::params::common_package_name,
|
||||
$host = $::os_service_default,
|
||||
$root_helper = 'sudo designate-rootwrap /etc/designate/rootwrap.conf',
|
||||
$state_path = $::designate::params::state_path,
|
||||
$notification_transport_url = $::os_service_default,
|
||||
|
@ -169,6 +174,7 @@ class designate(
|
|||
|
||||
# default setting
|
||||
designate_config {
|
||||
'DEFAULT/host': value => $host;
|
||||
'DEFAULT/root_helper': value => $root_helper;
|
||||
'DEFAULT/state_path' : value => $state_path;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The ``designate::host`` parameter has been added.
|
|
@ -33,17 +33,27 @@ describe 'designate' do
|
|||
it_configures 'a designate base installation'
|
||||
end
|
||||
|
||||
context 'without state_path' do
|
||||
it { is_expected.to contain_designate_config('DEFAULT/state_path').with_value('/var/lib/designate') }
|
||||
context 'without parameters' do
|
||||
it 'configures the default values' do
|
||||
is_expected.to contain_designate_config('DEFAULT/host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_designate_config('DEFAULT/state_path').with_value('/var/lib/designate')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with state_path' do
|
||||
context 'with parameters' do
|
||||
let :params do
|
||||
{ :state_path => '/var/tmp/designate' }
|
||||
{
|
||||
:host => 'current_hostname',
|
||||
:state_path => '/var/tmp/designate'
|
||||
}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_designate_config('DEFAULT/state_path').with_value('/var/tmp/designate') }
|
||||
it 'configures the given values' do
|
||||
is_expected.to contain_designate_config('DEFAULT/host').with_value('current_hostname')
|
||||
is_expected.to contain_designate_config('DEFAULT/state_path').with_value('/var/tmp/designate')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
shared_examples_for 'a designate base installation' do
|
||||
|
|
Loading…
Reference in New Issue