Takashi Kajinami cf3eda1a4a Use yaml instead of json for policy file
Because usage of json for policy file will be deprecated and replaced
by yaml[1].

[1] https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Depends-on: https://review.opendev.org/769647
Change-Id: I5990be7fb911e89b4a54bcc4776c8227cb36a926
2021-01-07 23:23:25 +00:00

48 lines
1.0 KiB
Puppet

# == Class: manila::policy
#
# Configure the manila policies
#
# === Parameters
#
# [*policies*]
# (Optional) Set of policies to configure for manila
# Example :
# {
# 'manila-context_is_admin' => {
# 'key' => 'context_is_admin',
# 'value' => 'true'
# },
# 'manila-default' => {
# 'key' => 'default',
# 'value' => 'rule:admin_or_owner'
# }
# }
# Defaults to empty hash.
#
# [*policy_path*]
# (Optional) Path to the manila policy.yaml file
# Defaults to /etc/manila/policy.yaml
#
class manila::policy (
$policies = {},
$policy_path = '/etc/manila/policy.yaml',
) {
include manila::deps
include manila::params
validate_legacy(Hash, 'validate_hash', $policies)
Openstacklib::Policy::Base {
file_path => $policy_path,
file_user => 'root',
file_group => $::manila::params::group,
file_format => 'yaml',
}
create_resources('openstacklib::policy::base', $policies)
oslo::policy { 'manila_config': policy_file => $policy_path }
}