From f48b463908e6e8a317d3c9e8f7b7c867070f8d74 Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Thu, 1 Apr 2021 23:21:48 +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: I4a81d4666f52e0305a5ef9880b0f42023cca5f08 --- manifests/policy.pp | 8 +++++++- releasenotes/notes/policy-dirs-e20f57e2b7987350.yaml | 5 +++++ spec/classes/octavia_policy_spec.rb | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/policy-dirs-e20f57e2b7987350.yaml diff --git a/manifests/policy.pp b/manifests/policy.pp index 1f954ddc..1c416f52 100644 --- a/manifests/policy.pp +++ b/manifests/policy.pp @@ -32,11 +32,16 @@ # (Optional) Path to the octavia policy.yaml file # Defaults to /etc/octavia/policy.yaml # +# [*policy_dirs*] +# (Optional) Path to the octavia policy folder +# Defaults to $::os_service_default +# class octavia::policy ( $enforce_scope = $::os_service_default, $enforce_new_defaults = $::os_service_default, $policies = {}, $policy_path = '/etc/octavia/policy.yaml', + $policy_dirs = $::os_service_default, ) { include octavia::deps @@ -56,7 +61,8 @@ class octavia::policy ( oslo::policy { 'octavia_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-e20f57e2b7987350.yaml b/releasenotes/notes/policy-dirs-e20f57e2b7987350.yaml new file mode 100644 index 00000000..4388bc3f --- /dev/null +++ b/releasenotes/notes/policy-dirs-e20f57e2b7987350.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + There is now a new policy_dirs parameter in the octavia::policy class, + so one can set a custom path. diff --git a/spec/classes/octavia_policy_spec.rb b/spec/classes/octavia_policy_spec.rb index 1edd6c33..b1fc44c4 100644 --- a/spec/classes/octavia_policy_spec.rb +++ b/spec/classes/octavia_policy_spec.rb @@ -7,6 +7,7 @@ describe 'octavia::policy' do :enforce_scope => false, :enforce_new_defaults => false, :policy_path => '/etc/octavia/policy.yaml', + :policy_dirs => '/etc/octavia/policy.d', :policies => { 'context_is_admin' => { 'key' => 'context_is_admin', @@ -28,6 +29,7 @@ describe 'octavia::policy' do :enforce_scope => false, :enforce_new_defaults => false, :policy_file => '/etc/octavia/policy.yaml', + :policy_dirs => '/etc/octavia/policy.d', ) end end