Expose policy_default_rule

The option has been managed by the underlying puppet-oslo module but
has not been configurable. This introduces the parameter to customize
the option.

Change-Id: Idcd4b7afac385757702577f7eb5e73e7a460fe86
This commit is contained in:
Takashi Kajinami 2023-01-23 14:57:27 +09:00
parent 98cef7d146
commit 612c802c76
2 changed files with 8 additions and 0 deletions

View File

@ -32,6 +32,10 @@
# (Optional) Path to the {{cookiecutter.project_name}} policy.yaml file
# Defaults to /etc/{{cookiecutter.project_name}}/policy.yaml
#
# [*policy_default_rule*]
# (Optional) Default rule. Enforced when a requested rule is not found.
# Defaults to $::os_service_default.
#
# [*policy_dirs*]
# (Optional) Path to the {{cookiecutter.project_name}} policy folder
# Defaults to $::os_service_default
@ -46,6 +50,7 @@ class {{cookiecutter.project_name}}::policy (
$enforce_new_defaults = $::os_service_default,
$policies = {},
$policy_path = '/etc/{{cookiecutter.project_name}}/policy.yaml',
$policy_default_rule = $::os_service_default,
$policy_dirs = $::os_service_default,
$purge_config = false,
) {
@ -70,6 +75,7 @@ class {{cookiecutter.project_name}}::policy (
enforce_scope => $enforce_scope,
enforce_new_defaults => $enforce_new_defaults,
policy_file => $policy_path,
policy_default_rule => $policy_default_rule,
policy_dirs => $policy_dirs,
}

View File

@ -9,6 +9,7 @@ describe '{{cookiecutter.project_name}}::policy' do
:enforce_scope => false,
:enforce_new_defaults => false,
:policy_path => '/etc/{{cookiecutter.project_name}}/policy.yaml',
:policy_default_rule => 'default',
:policy_dirs => '/etc/{{cookiecutter.project_name}}/policy.d',
:policies => {
'context_is_admin' => {
@ -37,6 +38,7 @@ describe '{{cookiecutter.project_name}}::policy' do
:enforce_scope => false,
:enforce_new_defaults => false,
:policy_file => '/etc/{{cookiecutter.project_name}}/policy.yaml',
:policy_default_rule => 'default',
:policy_dirs => '/etc/{{cookiecutter.project_name}}/policy.d',
)
end