Add backend coordination url option to producer

Producers that are deployed in an HA environment that do not have
a coordination url set will produce multiple copies of the same
thing and operate in standalone mode.

Change-Id: Idb5ecfd027728dc0c85ffac5ce08d475e6ea8cb6
This commit is contained in:
michaeltchapman 2020-08-10 13:31:05 +10:00
parent b97e1961c9
commit ba9fa2ad2e
2 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,10 @@
# (optional) List of tasks to enable, the default enables all tasks.
# Defaults to $::os_service_default.
#
# [*backend_url*]
# (optional) URL to use for coordination, should be a tooz URL.
# Defaults to $::os_service_default.
#
class designate::producer (
$package_ensure = 'present',
$package_name = $::designate::params::producer_package_name,
@ -40,12 +44,14 @@ class designate::producer (
$workers = $::os_workers,
$threads = $::os_service_default,
$enabled_tasks = $::os_service_default,
$backend_url = $::os_service_default,
) inherits designate {
designate_config {
'service:producer/workers' : value => $workers;
'service:producer/threads' : value => $threads;
'service:producer/enabled_tasks' : value => $enabled_tasks;
'coordination/backend_url' : value => $backend_url;
}
designate::generic_service { 'producer':

View File

@ -14,6 +14,7 @@ describe 'designate::producer' do
:workers => '3',
:threads => '3000',
:enabled_tasks => ['domain_purge','periodic_secondary_refresh'],
:backend_url => 'redis://10.0.0.1:1234'
}
end
@ -37,6 +38,7 @@ describe 'designate::producer' do
is_expected.to contain_designate_config("service:producer/workers").with(:value => 8)
is_expected.to contain_designate_config("service:producer/threads").with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_designate_config("service:producer/enabled_tasks").with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_designate_config("coordination/backend_url").with(:value => '<SERVICE DEFAULT>')
end
end
@ -46,6 +48,7 @@ describe 'designate::producer' do
is_expected.to contain_designate_config("service:producer/workers").with(:value => '3')
is_expected.to contain_designate_config("service:producer/threads").with(:value => '3000')
is_expected.to contain_designate_config("service:producer/enabled_tasks").with(:value => ['domain_purge','periodic_secondary_refresh'])
is_expected.to contain_designate_config("coordination/backend_url").with(:value => 'redis://10.0.0.1:1234')
end
end
end