Add common implementation to manage [os_brick] options
The os-brick library now supports its own lock_path configuration. This adds the defined resource type to manage the option so that we can reuse this implementation in some modules. Depends-on: https://review.opendev.org/c/openstack/os-brick/+/849324 Change-Id: Iae1c155692fec845a8cab0ae284eeeaaf3336962
This commit is contained in:
3 changed files with 64 additions and 0 deletions
19
manifests/os_brick.pp
Normal file
19
manifests/os_brick.pp
Normal file
@@ -0,0 +1,19 @@
#==Define:oslo::os_brick
#
#Configureos_brickoptions
#
#===Parameters:
#
#[*lock_path*]
#(Optional)Directorytouseforos-bricklockfiles.
#Defaultsto$::os_service_default
#
defineoslo::os_brick(
$lock_path=$::os_service_default,
){
$os_brick_options = {
'os_brick/lock_path' => { value => $lock_path },
}
create_resources($name,$os_brick_options)
}
6
releasenotes/notes/os_brick-444b69e1384bc260.yaml
Normal file
6
releasenotes/notes/os_brick-444b69e1384bc260.yaml
Normal file
@@ -0,0 +1,6 @@
---
features:
- |
The new ``oslo::os_brick`` defined resource type has been added. This can
be used to manage the ``[os_brick]`` options provided by the ``os-brick``
library.
39
spec/defines/oslo_os_brick_spec.rb
Normal file
39
spec/defines/oslo_os_brick_spec.rb
Normal file
@@ -0,0 +1,39 @@
require 'spec_helper'
describe 'oslo::os_brick' do
let (:title) { 'keystone_config' }
shared_examples 'oslo::os_brick' do
context 'with defaults' do
it 'configures the default values' do
is_expected.to contain_keystone_config('os_brick/lock_path').with_value('<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_keystone_config('os_brick/lock_path').with_value('/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 'oslo::os_brick'
end
end
end
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.