From 37bd354401e39778162e5ec9aa86e3fd4354cb46 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 1 Apr 2021 23:01:27 +0200 Subject: [PATCH] Allow to configure policy_dirs This patch makes it possible to override the current service default, which is /etc//policy.d . Change-Id: I9dea409a46bd8d22388853582de8f64034cf0d03 --- manifests/policy.pp | 8 +++++++- releasenotes/notes/policy-dirs-cda108ad862f7e05.yaml | 5 +++++ spec/classes/heat_policy_spec.rb | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/policy-dirs-cda108ad862f7e05.yaml diff --git a/manifests/policy.pp b/manifests/policy.pp index 0fef06bb..59f518e1 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -32,11 +32,16 @@ # (Optional) Path to the heat policy.yaml file # Defaults to /etc/heat/policy.yaml # +# [*policy_dirs*] +# (Optional) Path to the heat policy folder +# Defaults to $::os_service_default +# class heat::policy ( $enforce_scope = $::os_service_default, $enforce_new_defaults = $::os_service_default, $policies = {}, $policy_path = '/etc/heat/policy.yaml', + $policy_dirs = $::os_service_default, ) { include heat::deps @@ -56,7 +61,8 @@ class heat::policy ( oslo::policy { 'heat_config': enforce_scope => $enforce_scope, enforce_new_defaults => $enforce_new_defaults, - policy_file => $policy_path + policy_file => $policy_path, + policy_dirs => $policy_dirs, } } diff --git a/releasenotes/notes/policy-dirs-cda108ad862f7e05.yaml b/releasenotes/notes/policy-dirs-cda108ad862f7e05.yaml new file mode 100644 index 00000000..c2b446ed --- /dev/null +++ b/releasenotes/notes/policy-dirs-cda108ad862f7e05.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + There is now a new policy_dirs parameter in the heat::policy class, + so one can set a custom path. diff --git a/spec/classes/heat_policy_spec.rb b/spec/classes/heat_policy_spec.rb index 02473819..ab777b5b 100644 --- a/spec/classes/heat_policy_spec.rb +++ b/spec/classes/heat_policy_spec.rb @@ -7,6 +7,7 @@ describe 'heat::policy' do :enforce_scope => false, :enforce_new_defaults => false, :policy_path => '/etc/heat/policy.yaml', + :policy_dirs => '/etc/heat/policy.d', :policies => { 'context_is_admin' => { 'key' => 'context_is_admin', @@ -28,6 +29,7 @@ describe 'heat::policy' do :enforce_scope => false, :enforce_new_defaults => false, :policy_file => '/etc/heat/policy.yaml', + :policy_dirs => '/etc/heat/policy.d', ) end end