From acd9bf33731a5a727d43555d892c4b9f5e7fe6d7 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 23 Jan 2023 10:53:21 +0900 Subject: [PATCH] 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: I7eb5ab771da3b6e2c446f4d8e83394a544fd147d --- manifests/policy.pp | 6 ++++++ .../notes/policy_default_rule-254db8eee93b411a.yaml | 4 ++++ spec/classes/barbican_policy_spec.rb | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 releasenotes/notes/policy_default_rule-254db8eee93b411a.yaml diff --git a/manifests/policy.pp b/manifests/policy.pp index e584cd23..bcf8cfbf 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -32,6 +32,10 @@ # (Optional) Path to the barbican policy.yaml file # Defaults to /etc/barbican/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 barbican policy folder # Defaults to $::os_service_default @@ -46,6 +50,7 @@ class barbican::policy ( $enforce_new_defaults = $::os_service_default, $policies = {}, $policy_path = '/etc/barbican/policy.yaml', + $policy_default_rule = $::os_service_default, $policy_dirs = $::os_service_default, $purge_config = false, ) { @@ -70,6 +75,7 @@ class barbican::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, } diff --git a/releasenotes/notes/policy_default_rule-254db8eee93b411a.yaml b/releasenotes/notes/policy_default_rule-254db8eee93b411a.yaml new file mode 100644 index 00000000..66d7308a --- /dev/null +++ b/releasenotes/notes/policy_default_rule-254db8eee93b411a.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``barbican::policy::policy_default_rule`` parameter has been added. diff --git a/spec/classes/barbican_policy_spec.rb b/spec/classes/barbican_policy_spec.rb index aad32224..b115db57 100644 --- a/spec/classes/barbican_policy_spec.rb +++ b/spec/classes/barbican_policy_spec.rb @@ -9,6 +9,7 @@ describe 'barbican::policy' do :enforce_scope => false, :enforce_new_defaults => false, :policy_path => '/etc/barbican/policy.yaml', + :policy_default_rule => 'default', :policy_dirs => '/etc/barbican/policy.d', :policies => { 'context_is_admin' => { @@ -37,6 +38,7 @@ describe 'barbican::policy' do :enforce_scope => false, :enforce_new_defaults => false, :policy_file => '/etc/barbican/policy.yaml', + :policy_default_rule => 'default', :policy_dirs => '/etc/barbican/policy.d', ) end