diff --git a/manifests/os_brick.pp b/manifests/os_brick.pp new file mode 100644 index 0000000..9bc37bd --- /dev/null +++ b/manifests/os_brick.pp @@ -0,0 +1,19 @@ +# == Define: oslo::os_brick +# +# Configure os_brick options +# +# === Parameters: +# +# [*lock_path*] +# (Optional) Directory to use for os-brick lock files. +# Defaults to $::os_service_default +# +define oslo::os_brick( + $lock_path = $::os_service_default, +) { + + $os_brick_options = { + 'os_brick/lock_path' => { value => $lock_path }, + } + create_resources($name, $os_brick_options) +} diff --git a/releasenotes/notes/os_brick-444b69e1384bc260.yaml b/releasenotes/notes/os_brick-444b69e1384bc260.yaml new file mode 100644 index 0000000..80798a5 --- /dev/null +++ b/releasenotes/notes/os_brick-444b69e1384bc260.yaml @@ -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. diff --git a/spec/defines/oslo_os_brick_spec.rb b/spec/defines/oslo_os_brick_spec.rb new file mode 100644 index 0000000..a3a0fe9 --- /dev/null +++ b/spec/defines/oslo_os_brick_spec.rb @@ -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('') + 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