Merge "Add support for oslo_policy/enforce_new_defaults"
This commit is contained in:
commit
57a02ddb06
manifests
releasenotes/notes
spec/classes
@ -8,6 +8,11 @@
|
|||||||
# (Optional) Whether or not to enforce scope when evaluating policies.
|
# (Optional) Whether or not to enforce scope when evaluating policies.
|
||||||
# Defaults to $::os_service_default.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
|
# [*enforce_new_defaults*]
|
||||||
|
# (Optional) Whether or not to use old deprecated defaults when evaluating
|
||||||
|
# policies.
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
# [*policies*]
|
# [*policies*]
|
||||||
# (Optional) Set of policies to configure for magnum
|
# (Optional) Set of policies to configure for magnum
|
||||||
# Example :
|
# Example :
|
||||||
@ -28,9 +33,10 @@
|
|||||||
# Defaults to /etc/magnum/policy.yaml
|
# Defaults to /etc/magnum/policy.yaml
|
||||||
#
|
#
|
||||||
class magnum::policy (
|
class magnum::policy (
|
||||||
$enforce_scope = $::os_service_default,
|
$enforce_scope = $::os_service_default,
|
||||||
$policies = {},
|
$enforce_new_defaults = $::os_service_default,
|
||||||
$policy_path = '/etc/magnum/policy.yaml',
|
$policies = {},
|
||||||
|
$policy_path = '/etc/magnum/policy.yaml',
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include magnum::deps
|
include magnum::deps
|
||||||
@ -48,8 +54,9 @@ class magnum::policy (
|
|||||||
create_resources('openstacklib::policy::base', $policies)
|
create_resources('openstacklib::policy::base', $policies)
|
||||||
|
|
||||||
oslo::policy { 'magnum_config':
|
oslo::policy { 'magnum_config':
|
||||||
enforce_scope => $enforce_scope,
|
enforce_scope => $enforce_scope,
|
||||||
policy_file => $policy_path
|
enforce_new_defaults => $enforce_new_defaults,
|
||||||
|
policy_file => $policy_path
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``magnum::policy::enforce_new_defaults`` parameter has been
|
||||||
|
added.
|
@ -4,9 +4,10 @@ describe 'magnum::policy' do
|
|||||||
shared_examples 'magnum::policy' do
|
shared_examples 'magnum::policy' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:enforce_scope => false,
|
:enforce_scope => false,
|
||||||
:policy_path => '/etc/magnum/policy.yaml',
|
:enforce_new_defaults => false,
|
||||||
:policies => {
|
:policy_path => '/etc/magnum/policy.yaml',
|
||||||
|
:policies => {
|
||||||
'context_is_admin' => {
|
'context_is_admin' => {
|
||||||
'key' => 'context_is_admin',
|
'key' => 'context_is_admin',
|
||||||
'value' => 'foo:bar'
|
'value' => 'foo:bar'
|
||||||
@ -24,8 +25,9 @@ describe 'magnum::policy' do
|
|||||||
:file_format => 'yaml',
|
:file_format => 'yaml',
|
||||||
})
|
})
|
||||||
is_expected.to contain_oslo__policy('magnum_config').with(
|
is_expected.to contain_oslo__policy('magnum_config').with(
|
||||||
:enforce_scope => false,
|
:enforce_scope => false,
|
||||||
:policy_file => '/etc/magnum/policy.yaml',
|
:enforce_new_defaults => false,
|
||||||
|
:policy_file => '/etc/magnum/policy.yaml',
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user