Files
puppet-mistral/manifests/policy.pp
Takashi Kajinami 2f6e5287ea 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: Id574941a1f5169df903e43b8a3f2173e82d14415
2021-01-07 23:23:46 +00:00

48 lines
1.0 KiB
Puppet

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