Support [os_brick] lock_path

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

Depends-on: https://review.opendev.org/865771
Change-Id: Ib3b914b83bb61de1592553f7b43d0eace7c26903
This commit is contained in:
Takashi Kajinami 2022-11-27 02:01:56 +09:00 committed by Takashi Kajinami
parent 3f705c3921
commit 5218e2ff86
3 changed files with 64 additions and 0 deletions

18
manifests/os_brick.pp Normal file
View File

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

View File

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

View File

@ -0,0 +1,41 @@
require 'spec_helper'
describe 'nova::os_brick' do
shared_examples 'nova::os_brick' do
context 'with defaults' do
it 'configures the default values' do
is_expected.to contain_oslo__os_brick('nova_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('nova_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 'nova::os_brick'
end
end
end