Browse Source

Merge "Allow to configure policy_dirs"

master
Zuul 1 week ago
committed by Gerrit Code Review
parent
commit
bddcf2c7c9
3 changed files with 14 additions and 1 deletions
  1. +7
    -1
      manifests/policy.pp
  2. +5
    -0
      releasenotes/notes/policy-dirs-bfb89b7f99c56810.yaml
  3. +2
    -0
      spec/classes/ironic_policy_spec.rb

+ 7
- 1
manifests/policy.pp View File

@ -32,11 +32,16 @@
# (Optional) Path to the ironic policy.yaml file
# Defaults to /etc/ironic/policy.yaml
#
# [*policy_dirs*]
# (Optional) Path to the ironic policy folder
# Defaults to $::os_service_default
#
class ironic::policy (
$enforce_scope = $::os_service_default,
$enforce_new_defaults = $::os_service_default,
$policies = {},
$policy_path = '/etc/ironic/policy.yaml',
$policy_dirs = $::os_service_default,
) {
include ironic::deps
@ -56,7 +61,8 @@ class ironic::policy (
oslo::policy { 'ironic_config':
enforce_scope => $enforce_scope,
enforce_new_defaults => $enforce_new_defaults,
policy_file => $policy_path
policy_file => $policy_path,
policy_dirs => $policy_dirs,
}
}

+ 5
- 0
releasenotes/notes/policy-dirs-bfb89b7f99c56810.yaml View File

@ -0,0 +1,5 @@
---
features:
- |
There is now a new policy_dirs parameter in the ironic::policy class,
so one can set a custom path.

+ 2
- 0
spec/classes/ironic_policy_spec.rb View File

@ -7,6 +7,7 @@ describe 'ironic::policy' do
:enforce_scope => false,
:enforce_new_defaults => false,
:policy_path => '/etc/ironic/policy.yaml',
:policy_dirs => '/etc/ironic/policy.d',
:policies => {
'context_is_admin' => {
'key' => 'context_is_admin',
@ -28,6 +29,7 @@ describe 'ironic::policy' do
:enforce_scope => false,
:enforce_new_defaults => false,
:policy_file => '/etc/ironic/policy.yaml',
:policy_dirs => '/etc/ironic/policy.d',
)
end
end


Loading…
Cancel
Save