Add support for [DEFAULT] supported_record_type

Change-Id: I566dca39f9d0d9b85f33a30a593f08000f705baf
This commit is contained in:
Takashi Kajinami 2022-08-28 23:10:45 +09:00
parent 3d68d191e2
commit 86766620b8
3 changed files with 29 additions and 7 deletions

View File

@ -114,6 +114,10 @@
# (Optional) TTL Value.
# Defaults to $::os_service_default.
#
# [*supported_record_type*]
# (Optional) Supported record types.
# Defaults to $::os_service_default.
#
class designate(
$package_ensure = present,
$common_package_name = $::designate::params::common_package_name,
@ -138,6 +142,7 @@ class designate(
$purge_config = false,
$amqp_durable_queues = $::os_service_default,
$default_ttl = $::os_service_default,
$supported_record_type = $::os_service_default,
) inherits designate::params {
include designate::deps
@ -179,10 +184,11 @@ class designate(
# default setting
designate_config {
'DEFAULT/host': value => $host;
'DEFAULT/root_helper': value => $root_helper;
'DEFAULT/state_path' : value => $state_path;
'DEFAULT/default_ttl': value => $default_ttl;
'DEFAULT/host': value => $host;
'DEFAULT/root_helper': value => $root_helper;
'DEFAULT/state_path' : value => $state_path;
'DEFAULT/default_ttl': value => $default_ttl;
'DEFAULT/supported_record_type': value => join(any2array($supported_record_type), ',');
}
}

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``designate::supported_record_type`` parameter has been added.

View File

@ -38,15 +38,17 @@ describe 'designate' 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')
is_expected.to contain_designate_config('DEFAULT/default_ttl').with_value('<SERVICE DEFAULT>')
is_expected.to contain_designate_config('DEFAULT/supported_record_type').with_value('<SERVICE DEFAULT>')
end
end
context 'with parameters' do
let :params do
{
:host => 'current_hostname',
:state_path => '/var/tmp/designate',
:default_ttl => 3600
:host => 'current_hostname',
:state_path => '/var/tmp/designate',
:default_ttl => 3600,
:supported_record_type => 'A,AAAA'
}
end
@ -54,9 +56,19 @@ describe 'designate' 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')
is_expected.to contain_designate_config('DEFAULT/default_ttl').with_value(3600)
is_expected.to contain_designate_config('DEFAULT/supported_record_type').with_value('A,AAAA')
end
end
context 'with supported_record_type (array)' do
let :params do
{ :supported_record_type => ['A', 'AAAA'] }
end
it 'configures the given values' do
is_expected.to contain_designate_config('DEFAULT/supported_record_type').with_value('A,AAAA')
end
end
end
shared_examples_for 'a designate base installation' do