From e5c3e2756dd07ae8d26afdecc4b9f70f1646905e Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 23 Jan 2023 14:24:59 +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: Ib7d19a8d3b634b3f2c88222881b175f74771de00 --- manifests/policy.pp | 6 ++++++ .../notes/policy_default_rule-eca19237c1b9fd01.yaml | 4 ++++ spec/classes/heat_policy_spec.rb | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 releasenotes/notes/policy_default_rule-eca19237c1b9fd01.yaml diff --git a/manifests/policy.pp b/manifests/policy.pp index f18b56e9..8c137697 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -32,6 +32,10 @@ # (Optional) Path to the heat policy.yaml file # Defaults to /etc/heat/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 heat policy folder # Defaults to $::os_service_default @@ -46,6 +50,7 @@ class heat::policy ( $enforce_new_defaults = $::os_service_default, $policies = {}, $policy_path = '/etc/heat/policy.yaml', + $policy_default_rule = $::os_service_default, $policy_dirs = $::os_service_default, $purge_config = false, ) { @@ -70,6 +75,7 @@ class heat::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-eca19237c1b9fd01.yaml b/releasenotes/notes/policy_default_rule-eca19237c1b9fd01.yaml new file mode 100644 index 00000000..ab8a0727 --- /dev/null +++ b/releasenotes/notes/policy_default_rule-eca19237c1b9fd01.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``heat::policy::policy_default_rule`` parameter has been added. diff --git a/spec/classes/heat_policy_spec.rb b/spec/classes/heat_policy_spec.rb index 219e5e0f..143ee0e8 100644 --- a/spec/classes/heat_policy_spec.rb +++ b/spec/classes/heat_policy_spec.rb @@ -9,6 +9,7 @@ describe 'heat::policy' do :enforce_scope => false, :enforce_new_defaults => false, :policy_path => '/etc/heat/policy.yaml', + :policy_default_rule => 'default', :policy_dirs => '/etc/heat/policy.d', :policies => { 'context_is_admin' => { @@ -37,6 +38,7 @@ describe 'heat::policy' do :enforce_scope => false, :enforce_new_defaults => false, :policy_file => '/etc/heat/policy.yaml', + :policy_default_rule => 'default', :policy_dirs => '/etc/heat/policy.d', ) end