Add support for coordination parameters

Recent Tacker uses the tooz library to synchronize vnf action tasks[1].
This change introduces the new tacker::coordination class which manages
coordination parameters and backend packages using oslo::coordination
resource type.

[1] cff8c756822da5a8a7b92eec536db4532d31c408

Depends-on: https://review.opendev.org/791628
Change-Id: I3cb36be7fe6b43133f09ed6edce3f258786d7dc2
This commit is contained in:
Takashi Kajinami 2021-07-06 11:28:44 +09:00
parent 8ddfe2e2a1
commit f10b246ac0
3 changed files with 63 additions and 0 deletions

20
manifests/coordination.pp Normal file
View File

@ -0,0 +1,20 @@
# == Class: tacker::coordination
#
# Setup and configure Tacker coordination settings.
#
# === Parameters
#
# [*backend_url*]
# (Optional) Coordination backend URL.
# Defaults to $::os_service_default
#
class tacker::coordination (
$backend_url = $::os_service_default,
) {
include tacker::deps
oslo::coordination{ 'tacker_config':
backend_url => $backend_url
}
}

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``tacker::coordination`` class has been added.

View File

@ -0,0 +1,39 @@
require 'spec_helper'
describe 'tacker::coordination' do
shared_examples 'tacker::coordination' do
context 'with default parameters' do
it {
is_expected.to contain_oslo__coordination('tacker_config').with(
:backend_url => '<SERVICE DEFAULT>'
)
}
end
context 'with specified parameters' do
let :params do
{
:backend_url => 'etcd3+http://127.0.0.1:2379',
}
end
it {
is_expected.to contain_oslo__coordination('tacker_config').with(
:backend_url => 'etcd3+http://127.0.0.1:2379'
)
}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge(OSDefaults.get_facts())
end
it_behaves_like 'tacker::coordination'
end
end
end