Import base parameter types for ::policy

Import the parameter types from openstacklib::policy so that parameter
types are validated at module level, instead of internal resource
call.

Also remove the tag which is no longer necessary after dependency
refactoring.

Change-Id: I4d66c8753708fc993ff9f6053a367afc65dc9a76
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025-09-27 23:54:31 +09:00
parent 128da25ee2
commit 26e2e95b86
2 changed files with 8 additions and 12 deletions

View File

@@ -46,13 +46,13 @@
# Defaults to false.
#
class trove::policy (
$enforce_scope = $facts['os_service_default'],
$enforce_new_defaults = $facts['os_service_default'],
Hash $policies = {},
$policy_path = '/etc/trove/policy.yaml',
$policy_default_rule = $facts['os_service_default'],
$policy_dirs = $facts['os_service_default'],
Boolean $purge_config = false,
$enforce_scope = $facts['os_service_default'],
$enforce_new_defaults = $facts['os_service_default'],
Openstacklib::Policies $policies = {},
Stdlib::Absolutepath $policy_path = '/etc/trove/policy.yaml',
$policy_default_rule = $facts['os_service_default'],
$policy_dirs = $facts['os_service_default'],
Boolean $purge_config = false,
) {
include trove::deps
include trove::params
@@ -64,13 +64,11 @@ class trove::policy (
file_group => $trove::params::group,
file_format => 'yaml',
purge_config => $purge_config,
tag => 'trove',
}
create_resources('openstacklib::policy', { $policy_path => $policy_parameters })
# policy config should occur in the config block also as soon as
# puppet-trove supports it. Leave commented out for now.
# policy config should occur in the config block also.
Anchor['trove::config::begin']
-> Openstacklib::Policy[$policy_path]
-> Anchor['trove::config::end']

View File

@@ -33,7 +33,6 @@ describe 'trove::policy' do
:file_group => 'trove',
:file_format => 'yaml',
:purge_config => false,
:tag => 'trove',
)
is_expected.to contain_oslo__policy('trove_config').with(
:enforce_scope => false,
@@ -64,7 +63,6 @@ describe 'trove::policy' do
:file_group => 'trove',
:file_format => 'yaml',
:purge_config => true,
:tag => 'trove',
)
is_expected.to contain_oslo__policy('trove_config').with(
:enforce_scope => false,