Add support for the oslo_policy/enforce_scope parameter
Depends-on: https://review.opendev.org/#/c/759008/ Change-Id: If8e716e1bf9a6c6addee4ea6e487a2b273e3ba4a
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*enforce_scope*]
|
||||
# (Optional) Whether or not to enforce scope when evaluating policies.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*policies*]
|
||||
# (Optional) Set of policies to configure for octavia
|
||||
# Example :
|
||||
@@ -24,6 +28,7 @@
|
||||
# Defaults to /etc/octavia/policy.yaml
|
||||
#
|
||||
class octavia::policy (
|
||||
$enforce_scope = $::os_service_default,
|
||||
$policies = {},
|
||||
$policy_path = '/etc/octavia/policy.yaml',
|
||||
) {
|
||||
@@ -42,6 +47,9 @@ class octavia::policy (
|
||||
|
||||
create_resources('openstacklib::policy::base', $policies)
|
||||
|
||||
oslo::policy { 'octavia_config': policy_file => $policy_path }
|
||||
oslo::policy { 'octavia_config':
|
||||
enforce_scope => $enforce_scope,
|
||||
policy_file => $policy_path
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``octavia::policy::enforce_scope`` parameter has been added to
|
||||
support the corresponding parameter in oslo.policy library.
|
@@ -1,10 +1,10 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'octavia::policy' do
|
||||
|
||||
shared_examples_for 'octavia policies' do
|
||||
shared_examples 'octavia::policy' do
|
||||
let :params do
|
||||
{
|
||||
:enforce_scope => false,
|
||||
:policy_path => '/etc/octavia/policy.yaml',
|
||||
:policies => {
|
||||
'context_is_admin' => {
|
||||
@@ -24,6 +24,7 @@ describe 'octavia::policy' do
|
||||
:file_format => 'yaml',
|
||||
})
|
||||
is_expected.to contain_oslo__policy('octavia_config').with(
|
||||
:enforce_scope => false,
|
||||
:policy_file => '/etc/octavia/policy.yaml',
|
||||
)
|
||||
end
|
||||
@@ -37,7 +38,7 @@ describe 'octavia::policy' do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
it_configures 'octavia policies'
|
||||
it_behaves_like 'octavia::policy'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user