diff --git a/manifests/os_brick.pp b/manifests/os_brick.pp new file mode 100644 index 000000000..5642c4d2f --- /dev/null +++ b/manifests/os_brick.pp @@ -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 + } +} diff --git a/releasenotes/notes/os_brick-d7164dfcb0319654.yaml b/releasenotes/notes/os_brick-d7164dfcb0319654.yaml new file mode 100644 index 000000000..7583bac78 --- /dev/null +++ b/releasenotes/notes/os_brick-d7164dfcb0319654.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``nova::os_brick`` class has been added. This class manages + the ``[os_brick]`` options. diff --git a/spec/classes/nova_os_brick_spec.rb b/spec/classes/nova_os_brick_spec.rb new file mode 100644 index 000000000..2b5fa6732 --- /dev/null +++ b/spec/classes/nova_os_brick_spec.rb @@ -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 => '', + ) + 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