Support [os_brick] options

Cinder now supports configuration os-brick specific lock_path. This
adds the new class to manage the [os_brick] option.

Depends-on: https://review.opendev.org/849325
Depends-on: https://review.opendev.org/865771
Change-Id: I72a1cf7b982e96665b1d05170da223ebc4148281
This commit is contained in:
Takashi Kajinami 2022-11-27 01:58:00 +09:00
parent 3a63b7145b
commit 7ff34516ee
3 changed files with 64 additions and 0 deletions

18
manifests/os_brick.pp Normal file
View File

@ -0,0 +1,18 @@
# == Class: cinder::os_brick
#
# Configure os_brick options
#
# === Parameters:
#
# [*lock_path*]
# (Optional) Directory to use for os-brick lock files.
# Defaults to $::os_service_default
#
class cinder::os_brick(
$lock_path = $::os_service_default,
) {
oslo::os_brick { 'cinder_config':
lock_path => $lock_path
}
}

View File

@ -0,0 +1,5 @@
---
features:
- |
The new ``cinder::os_brick`` class has been added. This class manages
the ``[os_brick]`` options.

View File

@ -0,0 +1,41 @@
require 'spec_helper'
describe 'cinder::os_brick' do
shared_examples 'cinder::os_brick' do
context 'with defaults' do
it 'configures the default values' do
is_expected.to contain_oslo__os_brick('cinder_config').with(
:lock_path => '<SERVICE DEFAULT>',
)
end
end
context 'with parameters overridden' do
let :params do
{
:lock_path => '/var/lib/openstack/lock'
}
end
it 'configures the overridden values' do
is_expected.to contain_oslo__os_brick('cinder_config').with(
:lock_path => '/var/lib/openstack/lock',
)
end
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
include_examples 'cinder::os_brick'
end
end
end